parent
f65ca7a63a
commit
9a609bf6d6
@ -1,4 +1,3 @@ |
||||
import { RocketletRestApiClient } from './restclient'; |
||||
import { RocketletWebsocketReceiver } from './websockets'; |
||||
|
||||
export { RocketletRestApiClient, RocketletWebsocketReceiver }; |
||||
export { RocketletWebsocketReceiver }; |
||||
|
@ -1,30 +0,0 @@ |
||||
export class RocketletRestApiClient { |
||||
constructor(orch) { |
||||
this.orch = orch; |
||||
} |
||||
|
||||
get(endpoint, params) { |
||||
return this._jqueryCall('GET', endpoint, params); |
||||
} |
||||
|
||||
_jqueryCall(method, endpoint, params) { |
||||
return new Promise(function _rlRestApiGet(resolve, reject) { |
||||
jQuery.ajax({ |
||||
method, |
||||
url: `${ Meteor.absoluteUrl() }api/${ endpoint }`, |
||||
headers: { |
||||
'Content-Type': 'application/json', |
||||
'X-User-Id': localStorage['Meteor.userId'], |
||||
'X-Auth-Token': localStorage['Meteor.loginToken'] |
||||
}, |
||||
data: params, |
||||
success: function _rlGetSuccess(result) { |
||||
resolve(result); |
||||
}, |
||||
error: function _rlGetFailure(xhr, status, errorThrown) { |
||||
reject(new Error(errorThrown)); |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
} |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('archive', null, { |
||||
description: 'Archive', |
||||
params: '#channel' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('create', null, { |
||||
description: 'Create_A_New_Channel', |
||||
params: '#channel' |
||||
}); |
@ -1,3 +0,0 @@ |
||||
RocketChat.slashCommands.add('help', undefined, { |
||||
description: 'Show_the_keyboard_shortcut_list' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('invite', undefined, { |
||||
description: 'Invite_user_to_join_channel', |
||||
params: '@username' |
||||
}); |
@ -1,8 +0,0 @@ |
||||
RocketChat.slashCommands.add('invite-all-to', undefined, { |
||||
description: 'Invite_user_to_join_channel_all_to', |
||||
params: '#room' |
||||
}); |
||||
RocketChat.slashCommands.add('invite-all-from', undefined, { |
||||
description: 'Invite_user_to_join_channel_all_from', |
||||
params: '#room' |
||||
}); |
@ -1,10 +0,0 @@ |
||||
RocketChat.slashCommands.add('kick', function(command, params) { |
||||
const username = params.trim(); |
||||
if (username === '') { |
||||
return; |
||||
} |
||||
return username.replace('@', ''); |
||||
}, { |
||||
description: 'Remove_someone_from_room', |
||||
params: '@username' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('msg', undefined, { |
||||
description: 'Direct_message_someone', |
||||
params: '@username <message>' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('mute', undefined, { |
||||
description: 'Mute_someone_in_room', |
||||
params: '@username' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('unmute', undefined, { |
||||
description: 'Unmute_someone_in_room', |
||||
params: '@username' |
||||
}); |
@ -1,4 +0,0 @@ |
||||
RocketChat.slashCommands.add('unarchive', null, { |
||||
description: 'Unarchive', |
||||
params: '#channel' |
||||
}); |
Loading…
Reference in new issue