Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
chatwork-api
Advanced tools
A JavaScript wrapper for Chatwork APIs.
v1.0 Preview
$ npm i -S chatwork-api
2 main functions:
Utility for build chat message easier.
Create a new MessageBuilder instance with initial message and chat room id.
Get current message.
Get current messsge. Same as toString()
Set current message.
Append number
of new lines. Default is 1 line.
Append message
.
Prepend message
.
Send message to account_id
, then append to current message.
Reply to account_id
with message has id message_id
in room room_id
, then append to current message. Default of room_id
is instance.room_id
Quote message
of account_id
at timestamp
, then append to current message. timestamp
is optional.
Wrap info for message
with title
, then append to current message. title
is optional.
Wrap hr
, then append to current message.
Show profile icon for account_id
, then append to current message. When is_include_name
is true
, this will show both of profile icon and profile name. The default is false
.
The wrapper for Chatwork APIs.
Create new API instance with token, and request options.
Get the current request object.
Get current Chatwork api token.
Set Chatwork api token
Set Chatwork api token, and request options.
Get my profile.
Get current status.
Get my tasks.
Get my contacts.
Get my list chat rooms.
Create a new chat room.
options: {
description, // room description
icon_preset, // room icon. Default is `group`
name, // room name
members_admin_ids, // list of admin member ids [Integer, String, Array]
members_member_ids, // list of normal member ids [Integer, String, Array]
members_readonly_ids // list of readonly member ids [Integer, String, Array]
}
Get chat room detail.
Update chat room information.
options: {
description, // room description
icon_preset, // room icon. Default is `group`
name // room name
}
Leave chat room.
Delete chat room.
Get list members of a chat room.
Update list of members for a chat room.
options: {
members_admin_ids, // list of admin member ids [Integer, String, Array]
members_member_ids, // list of normal member ids [Integer, String, Array]
members_readonly_ids // list of readonly member ids [Integer, String, Array]
}
Get list messages.
Get message information.
Send a new message.
Get list taks.
options: {
account_id, // owner account id
assigned_by_account_id, // assigned account id
status // task content. Default is `open`
}
Get task information.
Create a new task.
options: {
body, // task content
limit, // task expiration
to_ids // assign to list of account_ids. [Integer, String, Array]
}
Get list files.
Get file information. Default of doCreateDownloadUrl
is false.
const API = require('chatwork-api', {
proxy: 'http://USER_NAME:USER_PASS@PROXY_URL:PROXY_PORT/'
})
const MessageBuilder = API.MessageBuilder
const STATUS = API.CONST.STATUS
// create new API instance with api token
let api = new API('YOUR_TOKEN_HERE')
// get my task
api.myTasks('ASSIGNED_BY_ACCOUNT_ID', STATUS.DONE)
.then(console.log)
.catch(console.error)
// create a new message with MessageBuilder
let builder = new MessageBuilder()
builder.to('ACCOUNT_ID') // send to ACCOUNT_ID
.append('Wellcome to this') // append message
.append('世界')
builder.n(2) // add 2 new lines
.append('Awesome ')
.profileIcon('ACCOUNT_ID', true) // add profile icon with user name
// send message in ROOM_ID
api.sendMessage('ROOM_ID', builder.message)
.then(console.log)
.catch(console.error)
FAQs
Chatwork API for JavaScript
The npm package chatwork-api receives a total of 3 weekly downloads. As such, chatwork-api popularity was classified as not popular.
We found that chatwork-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.