From 8861a8aef0a9e7c5851c282bb258dea3b01046c8 Mon Sep 17 00:00:00 2001 From: catalintomai <56169943+catalintomai@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:20:53 +0000 Subject: [PATCH] MM-60436 - remove telemetry api track calls (#28160) --- webapp/platform/client/src/client4.ts | 203 +------------------------- 1 file changed, 1 insertion(+), 202 deletions(-) diff --git a/webapp/platform/client/src/client4.ts b/webapp/platform/client/src/client4.ts index 1ad2e6e49b..3add78f75f 100644 --- a/webapp/platform/client/src/client4.ts +++ b/webapp/platform/client/src/client4.ts @@ -576,8 +576,6 @@ export default class Client4 { // User Routes createUser = (user: UserProfile, token: string, inviteId: string, redirect?: string) => { - this.trackEvent('api', 'api_users_create'); - const queryParams: any = {}; if (token) { @@ -606,8 +604,6 @@ export default class Client4 { }; patchUser = (userPatch: Partial & {id: string}) => { - this.trackEvent('api', 'api_users_patch'); - return this.doFetch( `${this.getUserRoute(userPatch.id)}/patch`, {method: 'put', body: JSON.stringify(userPatch)}, @@ -615,8 +611,6 @@ export default class Client4 { }; updateUser = (user: UserProfile) => { - this.trackEvent('api', 'api_users_update'); - return this.doFetch( `${this.getUserRoute(user.id)}`, {method: 'put', body: JSON.stringify(user)}, @@ -624,8 +618,6 @@ export default class Client4 { }; promoteGuestToUser = (userId: string) => { - this.trackEvent('api', 'api_users_promote_guest_to_user'); - return this.doFetch( `${this.getUserRoute(userId)}/promote`, {method: 'post'}, @@ -633,8 +625,6 @@ export default class Client4 { }; demoteUserToGuest = (userId: string) => { - this.trackEvent('api', 'api_users_demote_user_to_guest'); - return this.doFetch( `${this.getUserRoute(userId)}/demote`, {method: 'post'}, @@ -642,8 +632,6 @@ export default class Client4 { }; updateUserRoles = (userId: string, roles: string) => { - this.trackEvent('api', 'api_users_update_roles'); - return this.doFetch( `${this.getUserRoute(userId)}/roles`, {method: 'put', body: JSON.stringify({roles})}, @@ -666,8 +654,6 @@ export default class Client4 { }; updateUserPassword = (userId: string, currentPassword: string, newPassword: string) => { - this.trackEvent('api', 'api_users_newpassword'); - return this.doFetch( `${this.getUserRoute(userId)}/password`, {method: 'put', body: JSON.stringify({current_password: currentPassword, new_password: newPassword})}, @@ -675,8 +661,6 @@ export default class Client4 { }; resetUserPassword = (token: string, newPassword: string) => { - this.trackEvent('api', 'api_users_reset_password'); - return this.doFetch( `${this.getUsersRoute()}/password/reset`, {method: 'post', body: JSON.stringify({token, new_password: newPassword})}, @@ -691,8 +675,6 @@ export default class Client4 { }; sendPasswordResetEmail = (email: string) => { - this.trackEvent('api', 'api_users_send_password_reset'); - return this.doFetch( `${this.getUsersRoute()}/password/reset/send`, {method: 'post', body: JSON.stringify({email})}, @@ -700,8 +682,6 @@ export default class Client4 { }; updateUserActive = (userId: string, active: boolean) => { - this.trackEvent('api', 'api_users_update_active'); - return this.doFetch( `${this.getUserRoute(userId)}/active`, {method: 'put', body: JSON.stringify({active})}, @@ -709,8 +689,6 @@ export default class Client4 { }; uploadProfileImage = (userId: string, imageData: File) => { - this.trackEvent('api', 'api_users_update_profile_picture'); - const formData = new FormData(); formData.append('image', imageData); const request: any = { @@ -725,8 +703,6 @@ export default class Client4 { }; setDefaultProfileImage = (userId: string) => { - this.trackEvent('api', 'api_users_set_default_profile_picture'); - return this.doFetch( `${this.getUserRoute(userId)}/image`, {method: 'delete'}, @@ -769,12 +745,6 @@ export default class Client4 { }; login = async (loginId: string, password: string, token = '', ldapOnly = false) => { - this.trackEvent('api', 'api_users_login'); - - if (ldapOnly) { - this.trackEvent('api', 'api_users_login_ldap'); - } - const body: any = { login_id: loginId, password, @@ -814,7 +784,6 @@ export default class Client4 { }; loginById = (id: string, password: string, token = '') => { - this.trackEvent('api', 'api_users_login'); const body: any = { id, password, @@ -829,8 +798,6 @@ export default class Client4 { }; logout = async () => { - this.trackEvent('api', 'api_users_logout'); - const {response} = await this.doFetchWithResponse( `${this.getUsersRoute()}/logout`, {method: 'post'}, @@ -1066,8 +1033,6 @@ export default class Client4 { }; searchUsers = (term: string, options: any) => { - this.trackEvent('api', 'api_search_users'); - return this.doFetch( `${this.getUsersRoute()}/search`, {method: 'post', body: JSON.stringify({term, ...options})}, @@ -1125,8 +1090,6 @@ export default class Client4 { }; switchEmailToOAuth = (service: string, email: string, password: string, mfaCode = '') => { - this.trackEvent('api', 'api_users_email_to_oauth'); - return this.doFetch( `${this.getUsersRoute()}/login/switch`, {method: 'post', body: JSON.stringify({current_service: 'email', new_service: service, email, password, mfa_code: mfaCode})}, @@ -1134,8 +1097,6 @@ export default class Client4 { }; switchOAuthToEmail = (currentService: string, email: string, password: string) => { - this.trackEvent('api', 'api_users_oauth_to_email'); - return this.doFetch( `${this.getUsersRoute()}/login/switch`, {method: 'post', body: JSON.stringify({current_service: currentService, new_service: 'email', email, new_password: password})}, @@ -1143,8 +1104,6 @@ export default class Client4 { }; switchEmailToLdap = (email: string, emailPassword: string, ldapId: string, ldapPassword: string, mfaCode = '') => { - this.trackEvent('api', 'api_users_email_to_ldap'); - return this.doFetch( `${this.getUsersRoute()}/login/switch`, {method: 'post', body: JSON.stringify({current_service: 'email', new_service: 'ldap', email, password: emailPassword, ldap_id: ldapId, new_password: ldapPassword, mfa_code: mfaCode})}, @@ -1152,8 +1111,6 @@ export default class Client4 { }; switchLdapToEmail = (ldapPassword: string, email: string, emailPassword: string, mfaCode = '') => { - this.trackEvent('api', 'api_users_ldap_to_email'); - return this.doFetch( `${this.getUsersRoute()}/login/switch`, {method: 'post', body: JSON.stringify({current_service: 'ldap', new_service: 'email', email, password: ldapPassword, new_password: emailPassword, mfa_code: mfaCode})}, @@ -1182,8 +1139,6 @@ export default class Client4 { }; createUserAccessToken = (userId: string, description: string) => { - this.trackEvent('api', 'api_users_create_access_token'); - return this.doFetch( `${this.getUserRoute(userId)}/tokens`, {method: 'post', body: JSON.stringify({description})}, @@ -1212,8 +1167,6 @@ export default class Client4 { }; revokeUserAccessToken = (tokenId: string) => { - this.trackEvent('api', 'api_users_revoke_access_token'); - return this.doFetch( `${this.getUsersRoute()}/tokens/revoke`, {method: 'post', body: JSON.stringify({token_id: tokenId})}, @@ -1248,8 +1201,6 @@ export default class Client4 { // Team Routes createTeam = (team: Team) => { - this.trackEvent('api', 'api_teams_create'); - return this.doFetch( `${this.getTeamsRoute()}`, {method: 'post', body: JSON.stringify(team)}, @@ -1257,8 +1208,6 @@ export default class Client4 { }; deleteTeam = (teamId: string) => { - this.trackEvent('api', 'api_teams_delete'); - return this.doFetch( `${this.getTeamRoute(teamId)}`, {method: 'delete'}, @@ -1273,8 +1222,6 @@ export default class Client4 { }; updateTeam = (team: Team) => { - this.trackEvent('api', 'api_teams_update_name', {team_id: team.id}); - return this.doFetch( `${this.getTeamRoute(team.id)}`, {method: 'put', body: JSON.stringify(team)}, @@ -1282,8 +1229,6 @@ export default class Client4 { }; patchTeam = (team: Partial & {id: string}) => { - this.trackEvent('api', 'api_teams_patch_name', {team_id: team.id}); - return this.doFetch( `${this.getTeamRoute(team.id)}/patch`, {method: 'put', body: JSON.stringify(team)}, @@ -1291,8 +1236,6 @@ export default class Client4 { }; regenerateTeamInviteId = (teamId: string) => { - this.trackEvent('api', 'api_teams_regenerate_invite_id', {team_id: teamId}); - return this.doFetch( `${this.getTeamRoute(teamId)}/regenerate_invite_id`, {method: 'post'}, @@ -1302,8 +1245,6 @@ export default class Client4 { updateTeamScheme = (teamId: string, schemeId: string) => { const patch = {scheme_id: schemeId}; - this.trackEvent('api', 'api_teams_update_scheme', {team_id: teamId, ...patch}); - return this.doFetch( `${this.getTeamSchemeRoute(teamId)}`, {method: 'put', body: JSON.stringify(patch)}, @@ -1327,8 +1268,6 @@ export default class Client4 { searchTeams(term: string, opts: PagedTeamSearchOpts): Promise; searchTeams(term: string, opts: NotPagedTeamSearchOpts): Promise; searchTeams(term: string, opts: TeamSearchOpts): Promise { - this.trackEvent('api', 'api_search_teams'); - return this.doFetch( `${this.getTeamsRoute()}/search`, {method: 'post', body: JSON.stringify({term, ...opts})}, @@ -1343,8 +1282,6 @@ export default class Client4 { }; getTeamByName = (teamName: string) => { - this.trackEvent('api', 'api_teams_get_team_by_name'); - return this.doFetch( this.getTeamNameRoute(teamName), {method: 'get'}, @@ -1408,8 +1345,6 @@ export default class Client4 { }; addToTeam = (teamId: string, userId: string) => { - this.trackEvent('api', 'api_teams_invite_members', {team_id: teamId}); - const member = {user_id: userId, team_id: teamId}; return this.doFetch( `${this.getTeamMembersRoute(teamId)}`, @@ -1418,8 +1353,6 @@ export default class Client4 { }; addToTeamFromInvite = (token = '', inviteId = '') => { - this.trackEvent('api', 'api_teams_invite_members'); - const query = buildQueryString({token, invite_id: inviteId}); return this.doFetch( `${this.getTeamsRoute()}/members/invite${query}`, @@ -1428,8 +1361,6 @@ export default class Client4 { }; addUsersToTeam = (teamId: string, userIds: string[]) => { - this.trackEvent('api', 'api_teams_batch_add_members', {team_id: teamId, count: userIds.length}); - const members: any = []; userIds.forEach((id) => members.push({team_id: teamId, user_id: id})); return this.doFetch( @@ -1439,8 +1370,6 @@ export default class Client4 { }; addUsersToTeamGracefully = (teamId: string, userIds: string[]) => { - this.trackEvent('api', 'api_teams_batch_add_members', {team_id: teamId, count: userIds.length}); - const members: any = []; userIds.forEach((id) => members.push({team_id: teamId, user_id: id})); return this.doFetch( @@ -1458,8 +1387,6 @@ export default class Client4 { }; removeFromTeam = (teamId: string, userId: string) => { - this.trackEvent('api', 'api_teams_remove_members', {team_id: teamId}); - return this.doFetch( `${this.getTeamMemberRoute(teamId, userId)}`, {method: 'delete'}, @@ -1507,8 +1434,6 @@ export default class Client4 { }; updateTeamMemberRoles = (teamId: string, userId: string, roles: string[]) => { - this.trackEvent('api', 'api_teams_update_member_roles', {team_id: teamId}); - return this.doFetch( `${this.getTeamMemberRoute(teamId, userId)}/roles`, {method: 'put', body: JSON.stringify({roles})}, @@ -1516,8 +1441,6 @@ export default class Client4 { }; sendEmailInvitesToTeam = (teamId: string, emails: string[]) => { - this.trackEvent('api', 'api_teams_invite_members', {team_id: teamId}); - return this.doFetch( `${this.getTeamRoute(teamId)}/invite/email`, {method: 'post', body: JSON.stringify(emails)}, @@ -1534,8 +1457,6 @@ export default class Client4 { }; sendEmailInvitesToTeamGracefully = (teamId: string, emails: string[]) => { - this.trackEvent('api', 'api_teams_invite_members', {team_id: teamId}); - return this.doFetch( `${this.getTeamRoute(teamId)}/invite/email?graceful=true`, {method: 'post', body: JSON.stringify(emails)}, @@ -1548,8 +1469,6 @@ export default class Client4 { emails: string[], message: string, ) => { - this.trackEvent('api', 'api_teams_invite_members_to_channels', {team_id: teamId, channel_len: channelIds.length}); - return this.doFetch( `${this.getTeamRoute(teamId)}/invite/email?graceful=true`, {method: 'post', body: JSON.stringify({emails, channelIds, message})}, @@ -1575,8 +1494,6 @@ export default class Client4 { }; setTeamIcon = (teamId: string, imageData: File) => { - this.trackEvent('api', 'api_team_set_team_icon'); - const formData = new FormData(); formData.append('image', imageData); @@ -1592,8 +1509,6 @@ export default class Client4 { }; removeTeamIcon = (teamId: string) => { - this.trackEvent('api', 'api_team_remove_team_icon'); - return this.doFetch( `${this.getTeamRoute(teamId)}/image`, {method: 'delete'}, @@ -1653,8 +1568,6 @@ export default class Client4 { } createChannel = (channel: Channel) => { - this.trackEvent('api', 'api_channels_create', {team_id: channel.team_id}); - return this.doFetch( `${this.getChannelsRoute()}`, {method: 'post', body: JSON.stringify(channel)}, @@ -1662,8 +1575,6 @@ export default class Client4 { }; createDirectChannel = (userIds: string[]) => { - this.trackEvent('api', 'api_channels_create_direct'); - return this.doFetch( `${this.getChannelsRoute()}/direct`, {method: 'post', body: JSON.stringify(userIds)}, @@ -1671,8 +1582,6 @@ export default class Client4 { }; createGroupChannel = (userIds: string[]) => { - this.trackEvent('api', 'api_channels_create_group'); - return this.doFetch( `${this.getChannelsRoute()}/group`, {method: 'post', body: JSON.stringify(userIds)}, @@ -1680,8 +1589,6 @@ export default class Client4 { }; deleteChannel = (channelId: string) => { - this.trackEvent('api', 'api_channels_delete', {channel_id: channelId}); - return this.doFetch( `${this.getChannelRoute(channelId)}`, {method: 'delete'}, @@ -1689,8 +1596,6 @@ export default class Client4 { }; unarchiveChannel = (channelId: string) => { - this.trackEvent('api', 'api_channels_unarchive', {channel_id: channelId}); - return this.doFetch( `${this.getChannelRoute(channelId)}/restore`, {method: 'post'}, @@ -1698,8 +1603,6 @@ export default class Client4 { }; updateChannel = (channel: Channel) => { - this.trackEvent('api', 'api_channels_update', {channel_id: channel.id}); - return this.doFetch( `${this.getChannelRoute(channel.id)}`, {method: 'put', body: JSON.stringify(channel)}, @@ -1707,8 +1610,6 @@ export default class Client4 { }; updateChannelPrivacy = (channelId: string, privacy: any) => { - this.trackEvent('api', 'api_channels_update_privacy', {channel_id: channelId, privacy}); - return this.doFetch( `${this.getChannelRoute(channelId)}/privacy`, {method: 'put', body: JSON.stringify({privacy})}, @@ -1716,8 +1617,6 @@ export default class Client4 { }; patchChannel = (channelId: string, channelPatch: Partial) => { - this.trackEvent('api', 'api_channels_patch', {channel_id: channelId}); - return this.doFetch( `${this.getChannelRoute(channelId)}/patch`, {method: 'put', body: JSON.stringify(channelPatch)}, @@ -1725,8 +1624,6 @@ export default class Client4 { }; updateChannelNotifyProps = (props: any) => { - this.trackEvent('api', 'api_users_update_channel_notifications', {channel_id: props.channel_id}); - return this.doFetch( `${this.getChannelMemberRoute(props.channel_id, props.user_id)}/notify_props`, {method: 'put', body: JSON.stringify(props)}, @@ -1736,8 +1633,6 @@ export default class Client4 { updateChannelScheme = (channelId: string, schemeId: string) => { const patch = {scheme_id: schemeId}; - this.trackEvent('api', 'api_channels_update_scheme', {channel_id: channelId, ...patch}); - return this.doFetch( `${this.getChannelSchemeRoute(channelId)}`, {method: 'put', body: JSON.stringify(patch)}, @@ -1843,8 +1738,6 @@ export default class Client4 { }; addToChannels = (userIds: string[], channelId: string, postRootId = '') => { - this.trackEvent('api', 'api_channels_add_members', {channel_id: channelId}); - const members = {user_ids: userIds, channel_id: channelId, post_root_id: postRootId}; return this.doFetch( `${this.getChannelMembersRoute(channelId)}`, @@ -1853,8 +1746,6 @@ export default class Client4 { }; addToChannel = (userId: string, channelId: string, postRootId = '') => { - this.trackEvent('api', 'api_channels_add_member', {channel_id: channelId}); - const member = {user_id: userId, channel_id: channelId, post_root_id: postRootId}; return this.doFetch( `${this.getChannelMembersRoute(channelId)}`, @@ -1863,8 +1754,6 @@ export default class Client4 { }; removeFromChannel = (userId: string, channelId: string) => { - this.trackEvent('api', 'api_channels_remove_member', {channel_id: channelId}); - return this.doFetch( `${this.getChannelMemberRoute(channelId, userId)}`, {method: 'delete'}, @@ -2183,19 +2072,12 @@ export default class Client4 { analyticsData.priority = post.metadata.priority.priority; analyticsData.requested_ack = post.metadata.priority.requested_ack; analyticsData.persistent_notifications = post.metadata.priority.persistent_notifications; - } - - this.trackEvent('api', 'api_posts_create', analyticsData); - - if (result.root_id != null && result.root_id !== '') { - this.trackEvent('api', 'api_posts_replied', analyticsData); + this.trackEvent('api', 'api_posts_create', analyticsData); } return result; }; updatePost = (post: Post) => { - this.trackEvent('api', 'api_posts_update', {channel_id: post.channel_id, post_id: post.id}); - return this.doFetch( `${this.getPostRoute(post.id)}`, {method: 'put', body: JSON.stringify(post)}, @@ -2210,8 +2092,6 @@ export default class Client4 { }; patchPost = (postPatch: Partial & {id: string}) => { - this.trackEvent('api', 'api_posts_patch', {channel_id: postPatch.channel_id, post_id: postPatch.id}); - return this.doFetch( `${this.getPostRoute(postPatch.id)}/patch`, {method: 'put', body: JSON.stringify(postPatch)}, @@ -2219,8 +2099,6 @@ export default class Client4 { }; deletePost = (postId: string) => { - this.trackEvent('api', 'api_posts_delete'); - return this.doFetch( `${this.getPostRoute(postId)}`, {method: 'delete'}, @@ -2354,8 +2232,6 @@ export default class Client4 { }; getFlaggedPosts = (userId: string, channelId = '', teamId = '', page = 0, perPage = PER_PAGE_DEFAULT) => { - this.trackEvent('api', 'api_posts_get_flagged', {team_id: teamId}); - return this.doFetch( `${this.getUserRoute(userId)}/posts/flagged${buildQueryString({channel_id: channelId, team_id: teamId, page, per_page: perPage})}`, {method: 'get'}, @@ -2363,7 +2239,6 @@ export default class Client4 { }; getPinnedPosts = (channelId: string) => { - this.trackEvent('api', 'api_posts_get_pinned', {channel_id: channelId}); return this.doFetch( `${this.getChannelRoute(channelId)}/pinned`, {method: 'get'}, @@ -2371,8 +2246,6 @@ export default class Client4 { }; markPostAsUnread = (userId: string, postId: string) => { - this.trackEvent('api', 'api_post_set_unread_post'); - return this.doFetch( `${this.getUserRoute(userId)}/posts/${postId}/set_unread`, {method: 'post', body: JSON.stringify({collapsed_threads_supported: true})}, @@ -2380,8 +2253,6 @@ export default class Client4 { }; addPostReminder = (userId: string, postId: string, timestamp: number) => { - this.trackEvent('api', 'api_post_set_reminder'); - return this.doFetch( `${this.getUserRoute(userId)}/posts/${postId}/reminder`, {method: 'post', body: JSON.stringify({target_time: timestamp})}, @@ -2389,8 +2260,6 @@ export default class Client4 { }; pinPost = (postId: string) => { - this.trackEvent('api', 'api_posts_pin'); - return this.doFetch( `${this.getPostRoute(postId)}/pin`, {method: 'post'}, @@ -2398,8 +2267,6 @@ export default class Client4 { }; unpinPost = (postId: string) => { - this.trackEvent('api', 'api_posts_unpin'); - return this.doFetch( `${this.getPostRoute(postId)}/unpin`, {method: 'post'}, @@ -2428,8 +2295,6 @@ export default class Client4 { }; addReaction = (userId: string, postId: string, emojiName: string) => { - this.trackEvent('api', 'api_reactions_save', {post_id: postId}); - return this.doFetch( `${this.getReactionsRoute()}`, {method: 'post', body: JSON.stringify({user_id: userId, post_id: postId, emoji_name: emojiName})}, @@ -2437,8 +2302,6 @@ export default class Client4 { }; removeReaction = (userId: string, postId: string, emojiName: string) => { - this.trackEvent('api', 'api_reactions_delete', {post_id: postId}); - return this.doFetch( `${this.getUserRoute(userId)}/posts/${postId}/reactions/${emojiName}`, {method: 'delete'}, @@ -2453,8 +2316,6 @@ export default class Client4 { }; searchPostsWithParams = (teamId: string, params: any) => { - this.trackEvent('api', 'api_posts_search', {team_id: teamId}); - let route = `${this.getPostsRoute()}/search`; if (teamId) { route = `${this.getTeamRoute(teamId)}/posts/search`; @@ -2471,8 +2332,6 @@ export default class Client4 { }; searchFilesWithParams = (teamId: string, params: any) => { - this.trackEvent('api', 'api_files_search', {team_id: teamId}); - let route = `${this.getFilesRoute()}/search`; if (teamId) { route = `${this.getTeamRoute(teamId)}/files/search`; @@ -2493,12 +2352,6 @@ export default class Client4 { }; doPostActionWithCookie = (postId: string, actionId: string, actionCookie: string, selectedOption = '') => { - if (selectedOption) { - this.trackEvent('api', 'api_interactive_messages_menu_selected'); - } else { - this.trackEvent('api', 'api_interactive_messages_button_clicked'); - } - const msg: any = { selected_option: selectedOption, }; @@ -2541,7 +2394,6 @@ export default class Client4 { } uploadFile = (fileFormData: any, isBookmark?: boolean) => { - this.trackEvent('api', 'api_files_upload'); const request: any = { method: 'post', body: fileFormData, @@ -2572,8 +2424,6 @@ export default class Client4 { }; unacknowledgePost = (postId: string, userId: string) => { - this.trackEvent('api', 'api_posts_unack'); - return this.doFetch( `${this.getUserRoute(userId)}/posts/${postId}/ack`, {method: 'delete'}, @@ -2716,8 +2566,6 @@ export default class Client4 { // Integration Routes createIncomingWebhook = (hook: IncomingWebhook) => { - this.trackEvent('api', 'api_integrations_created', {team_id: hook.team_id}); - return this.doFetch( `${this.getIncomingHooksRoute()}`, {method: 'post', body: JSON.stringify(hook)}, @@ -2749,8 +2597,6 @@ export default class Client4 { }; removeIncomingWebhook = (hookId: string) => { - this.trackEvent('api', 'api_integrations_deleted'); - return this.doFetch( `${this.getIncomingHookRoute(hookId)}`, {method: 'delete'}, @@ -2758,8 +2604,6 @@ export default class Client4 { }; updateIncomingWebhook = (hook: IncomingWebhook) => { - this.trackEvent('api', 'api_integrations_updated', {team_id: hook.team_id}); - return this.doFetch( `${this.getIncomingHookRoute(hook.id)}`, {method: 'put', body: JSON.stringify(hook)}, @@ -2767,8 +2611,6 @@ export default class Client4 { }; createOutgoingWebhook = (hook: OutgoingWebhook) => { - this.trackEvent('api', 'api_integrations_created', {team_id: hook.team_id}); - return this.doFetch( `${this.getOutgoingHooksRoute()}`, {method: 'post', body: JSON.stringify(hook)}, @@ -2803,8 +2645,6 @@ export default class Client4 { }; removeOutgoingWebhook = (hookId: string) => { - this.trackEvent('api', 'api_integrations_deleted'); - return this.doFetch( `${this.getOutgoingHookRoute(hookId)}`, {method: 'delete'}, @@ -2812,8 +2652,6 @@ export default class Client4 { }; updateOutgoingWebhook = (hook: OutgoingWebhook) => { - this.trackEvent('api', 'api_integrations_updated', {team_id: hook.team_id}); - return this.doFetch( `${this.getOutgoingHookRoute(hook.id)}`, {method: 'put', body: JSON.stringify(hook)}, @@ -2856,8 +2694,6 @@ export default class Client4 { }; executeCommand = (command: string, commandArgs: CommandArgs) => { - this.trackEvent('api', 'api_integrations_used'); - return this.doFetch( `${this.getCommandsRoute()}/execute`, {method: 'post', body: JSON.stringify({command, ...commandArgs})}, @@ -2865,8 +2701,6 @@ export default class Client4 { }; addCommand = (command: Command) => { - this.trackEvent('api', 'api_integrations_created'); - return this.doFetch( `${this.getCommandsRoute()}`, {method: 'post', body: JSON.stringify(command)}, @@ -2874,8 +2708,6 @@ export default class Client4 { }; editCommand = (command: Command) => { - this.trackEvent('api', 'api_integrations_created'); - return this.doFetch( `${this.getCommandsRoute()}/${command.id}`, {method: 'put', body: JSON.stringify(command)}, @@ -2892,8 +2724,6 @@ export default class Client4 { }; deleteCommand = (id: string) => { - this.trackEvent('api', 'api_integrations_deleted'); - return this.doFetch( `${this.getCommandsRoute()}/${id}`, {method: 'delete'}, @@ -2901,8 +2731,6 @@ export default class Client4 { }; createOAuthApp = (app: OAuthApp) => { - this.trackEvent('api', 'api_apps_register'); - return this.doFetch( `${this.getOAuthAppsRoute()}`, {method: 'post', body: JSON.stringify(app)}, @@ -2966,8 +2794,6 @@ export default class Client4 { }; createOutgoingOAuthConnection = (teamId: string, connection: OutgoingOAuthConnection) => { - this.trackEvent('api', 'api_outgoing_oauth_connection_register'); - return this.doFetch( `${this.getOutgoingOAuthConnectionsRoute()}${buildQueryString({team_id: teamId})}`, {method: 'post', body: JSON.stringify(connection)}, @@ -2996,8 +2822,6 @@ export default class Client4 { }; deleteOAuthApp = (appId: string) => { - this.trackEvent('api', 'api_apps_delete'); - return this.doFetch( `${this.getOAuthAppRoute(appId)}`, {method: 'delete'}, @@ -3012,8 +2836,6 @@ export default class Client4 { }; deleteOutgoingOAuthConnection = (connectionId: string) => { - this.trackEvent('api', 'api_apps_delete'); - return this.doFetch( `${this.getOutgoingOAuthConnectionRoute(connectionId)}`, {method: 'delete'}, @@ -3021,7 +2843,6 @@ export default class Client4 { }; submitInteractiveDialog = (data: DialogSubmission) => { - this.trackEvent('api', 'api_interactive_messages_dialog_submitted'); return this.doFetch( `${this.getBaseRoute()}/actions/dialogs/submit`, {method: 'post', body: JSON.stringify(data)}, @@ -3031,8 +2852,6 @@ export default class Client4 { // Emoji Routes createCustomEmoji = (emoji: CustomEmoji, imageData: File) => { - this.trackEvent('api', 'api_emoji_custom_add'); - const formData = new FormData(); formData.append('image', imageData); formData.append('emoji', JSON.stringify(emoji)); @@ -3076,8 +2895,6 @@ export default class Client4 { }; deleteCustomEmoji = (emojiId: string) => { - this.trackEvent('api', 'api_emoji_custom_delete'); - return this.doFetch( `${this.getEmojiRoute(emojiId)}`, {method: 'delete'}, @@ -3556,8 +3373,6 @@ export default class Client4 { }; uploadLicense = (fileData: File) => { - this.trackEvent('api', 'api_license_upload'); - const formData = new FormData(); formData.append('license', fileData); @@ -3640,8 +3455,6 @@ export default class Client4 { }; createScheme = (scheme: Scheme) => { - this.trackEvent('api', 'api_schemes_create'); - return this.doFetch( `${this.getSchemesRoute()}`, {method: 'post', body: JSON.stringify(scheme)}, @@ -3656,8 +3469,6 @@ export default class Client4 { }; deleteScheme = (schemeId: string) => { - this.trackEvent('api', 'api_schemes_delete'); - return this.doFetch( `${this.getSchemesRoute()}/${schemeId}`, {method: 'delete'}, @@ -3665,8 +3476,6 @@ export default class Client4 { }; patchScheme = (schemeId: string, schemePatch: Partial) => { - this.trackEvent('api', 'api_schemes_patch', {scheme_id: schemeId}); - return this.doFetch( `${this.getSchemesRoute()}/${schemeId}/patch`, {method: 'put', body: JSON.stringify(schemePatch)}, @@ -3690,8 +3499,6 @@ export default class Client4 { // Plugin Routes uploadPlugin = async (fileData: File, force = false) => { - this.trackEvent('api', 'api_plugin_upload'); - const formData = new FormData(); if (force) { formData.append('force', 'true'); @@ -3710,8 +3517,6 @@ export default class Client4 { }; installPluginFromUrl = (pluginDownloadUrl: string, force = false) => { - this.trackEvent('api', 'api_install_plugin'); - const queryParams = {plugin_download_url: pluginDownloadUrl, force}; return this.doFetch( @@ -3742,8 +3547,6 @@ export default class Client4 { }; installMarketplacePlugin = (id: string) => { - this.trackEvent('api', 'api_install_marketplace_plugin'); - return this.doFetch( `${this.getPluginsMarketplaceRoute()}`, {method: 'post', body: JSON.stringify({id})}, @@ -3843,7 +3646,6 @@ export default class Client4 { }; getGroupsNotAssociatedToTeam = (teamID: string, q = '', page = 0, perPage = PER_PAGE_DEFAULT, source = 'ldap') => { - this.trackEvent('api', 'api_groups_get_not_associated_to_team', {team_id: teamID}); return this.doFetch( `${this.getGroupsRoute()}${buildQueryString({not_associated_to_team: teamID, page, per_page: perPage, q, include_member_count: true, group_source: source})}`, {method: 'get'}, @@ -3851,7 +3653,6 @@ export default class Client4 { }; getGroupsNotAssociatedToChannel = (channelID: string, q = '', page = 0, perPage = PER_PAGE_DEFAULT, filterParentTeamPermitted = false, source = 'ldap') => { - this.trackEvent('api', 'api_groups_get_not_associated_to_channel', {channel_id: channelID}); const query = { not_associated_to_channel: channelID, page, @@ -3924,8 +3725,6 @@ export default class Client4 { }; getGroupsAssociatedToTeam = (teamID: string, q = '', page = 0, perPage = PER_PAGE_DEFAULT, filterAllowReference = false) => { - this.trackEvent('api', 'api_groups_get_associated_to_team', {team_id: teamID}); - return this.doFetch<{ groups: Group[]; total_group_count: number;