chatwork-utils
Version:
A chatwork API utils
2 lines • 4.05 kB
JavaScript
;Object.defineProperty(exports,'__esModule',{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if('value'in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();var _baseChatwork2=require('./baseChatwork');var _baseChatwork3=_interopRequireDefault(_baseChatwork2);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function')}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')}return call&&(typeof call==='object'||typeof call==='function')?call:self}function _inherits(subClass,superClass){if(typeof superClass!=='function'&&superClass!==null){throw new TypeError('Super expression must either be null or a function, not '+typeof superClass)}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass}var chatworkRo=function(_baseChatwork){_inherits(chatworkRo,_baseChatwork);function chatworkRo(){_classCallCheck(this,chatworkRo);return _possibleConstructorReturn(this,(chatworkRo.__proto__||Object.getPrototypeOf(chatworkRo)).apply(this,arguments))}_createClass(chatworkRo,[{key:'me',value:function me(){return this.instance.get('/me')}},{key:'getMyStatus',value:function getMyStatus(){return this.instance.get('/my/status')}},{key:'listMyTasks',value:function listMyTasks(assignedByAccountId){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'open';return this.instance.get('/my/tasks',{params:{assigned_by_account_id:assignedByAccountId,status:status}})}},{key:'listMyContacts',value:function listMyContacts(){return this.instance.get('/contacts')}},{key:'listIncomingRequests',value:function listIncomingRequests(){return this.instance.get('/incoming_requests')}},{key:'listMyMessages',value:function listMyMessages(){return this.instance.get('/rooms')}},{key:'getRoomInfo',value:function getRoomInfo(roomId){return this.instance.get('/rooms/'+roomId)}},{key:'listRoomMembers',value:function listRoomMembers(roomId){return this.instance.get('/rooms/'+roomId+'/members')}},{key:'listRoomMessages',value:function listRoomMessages(roomId){var isForce=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.instance.get('/rooms/'+roomId+'/messages',{params:{force:isForce}})}},{key:'getMessageInfo',value:function getMessageInfo(roomId,messageId){return this.instance.get('/rooms/'+roomId+'/messages/'+messageId)}},{key:'listRoomTasks',value:function listRoomTasks(roomId,accountId,assignedByAccountId){var status=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'open';return this.instance.get('/rooms/'+roomId+'/tasks',{params:{account_id:accountId,assigned_by_account_id:assignedByAccountId,status:status}})}},{key:'getTaskInfo',value:function getTaskInfo(roomId,taskId){return this.instance.get('/rooms/'+roomId+'/tasks/'+taskId)}},{key:'listRoomFiles',value:function listRoomFiles(roomId,accountId){return this.instance.get('/rooms/'+roomId+'/files',{params:{account_id:accountId}})}},{key:'getFileInfo',value:function getFileInfo(roomId,fileId){var isUrl=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;return this.instance.get('/rooms/'+roomId+'/files/'+fileId,{params:{create_download_url:isUrl}})}}]);return chatworkRo}(_baseChatwork3.default);exports.default=chatworkRo;
//# sourceMappingURL=chatworkRo.js.map