mirror of
https://github.com/valentineus/iii-client.git
synced 2025-04-28 01:41:25 +03:00
Release of the version 3.2.2
This commit is contained in:
parent
178c6cbcb7
commit
e663da5081
74
.travis.yml
74
.travis.yml
@ -1,47 +1,61 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
- "8"
|
- "8"
|
||||||
- "7"
|
- "7"
|
||||||
- "6"
|
- "6"
|
||||||
- "5"
|
- "5"
|
||||||
- "4"
|
- "4"
|
||||||
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
- "info@valentineus.link"
|
- "info@valentineus.link"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- npm install --global nyc
|
- npm install --global nyc
|
||||||
- npm install --global codacy-coverage
|
- npm install --global codacy-coverage
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run check
|
- npm run check
|
||||||
- nyc npm run test
|
- nyc npm run test
|
||||||
- nyc report --reporter=lcov
|
- nyc report --reporter=lcov
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- nyc report --reporter=lcov
|
- nyc report --reporter=lcov
|
||||||
- cat ./coverage/lcov.info | codacy-coverage
|
- cat ./coverage/lcov.info | codacy-coverage
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: deploy
|
stage: deploy
|
||||||
node_js: "8"
|
node_js: "8"
|
||||||
os: "linux"
|
os: "linux"
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- git stash --all
|
- git stash --all
|
||||||
- npm install
|
- npm install
|
||||||
- npm run build
|
- npm run build
|
||||||
deploy:
|
- npm pack
|
||||||
provider: npm
|
deploy:
|
||||||
skip_cleanup: true
|
- provider: npm
|
||||||
email: "info@valentineus.link"
|
skip_cleanup: true
|
||||||
api_key: $NPM_PROJECT_TOKEN
|
email: "info@valentineus.link"
|
||||||
|
api_key: $NPM_PROJECT_TOKEN
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
|
||||||
|
- provider: releases
|
||||||
|
skip_cleanup: true
|
||||||
|
file_glob: true
|
||||||
|
file: "iii-client-*.tgz"
|
||||||
|
email: "info@valentineus.link"
|
||||||
|
api_key: $GITHUB_PROJECT_TOKEN
|
||||||
|
on:
|
||||||
|
tags: true
|
@ -1,4 +1,8 @@
|
|||||||
# Description of releases
|
# Description of releases
|
||||||
|
## 3.2.2 (08-11-2017)
|
||||||
|
- Fix a bug when using HTTPS.
|
||||||
|
- Expansion of the publication of the package.
|
||||||
|
|
||||||
## 3.2.1 (10-10-2017)
|
## 3.2.1 (10-10-2017)
|
||||||
Features:
|
Features:
|
||||||
- Minimize the published code.
|
- Minimize the published code.
|
||||||
|
10
README.md
10
README.md
@ -1,4 +1,6 @@
|
|||||||
# III Client
|
# III Client
|
||||||
|
|
||||||
|
[](https://github.com/valentineus/simple-container/releases)
|
||||||
[](https://www.npmjs.com/package/iii-client)
|
[](https://www.npmjs.com/package/iii-client)
|
||||||
[](https://travis-ci.org/valentineus/iii-client)
|
[](https://travis-ci.org/valentineus/iii-client)
|
||||||
[](https://www.codacy.com/app/valentineus/iii-client)
|
[](https://www.codacy.com/app/valentineus/iii-client)
|
||||||
@ -8,12 +10,14 @@
|
|||||||
Simple API for communicating with the bot of the \"iii.ru\" service.
|
Simple API for communicating with the bot of the \"iii.ru\" service.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Multiplatform library.
|
- Multiplatform library.
|
||||||
- A small and light library.
|
- A small and light library.
|
||||||
- Getting session ID.
|
- Getting session ID.
|
||||||
- Sending and receiving messages.
|
- Sending and receiving messages.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
NodeJS:
|
NodeJS:
|
||||||
```bash
|
```bash
|
||||||
npm install --save iii-client
|
npm install --save iii-client
|
||||||
@ -27,6 +31,7 @@ Browser:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
An example of a connection, receiving session identification and sending a bot message:
|
An example of a connection, receiving session identification and sending a bot message:
|
||||||
```javascript
|
```javascript
|
||||||
import { connect, send } from 'iii-client';
|
import { connect, send } from 'iii-client';
|
||||||
@ -47,7 +52,9 @@ send(cuid, text, (answer) => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<a href="#connect">connect(uuid, callback)</a>
|
<a href="#connect">connect(uuid, callback)</a>
|
||||||
@ -66,6 +73,7 @@ send(cuid, text, (answer) => {
|
|||||||
<a name="connect"></a>
|
<a name="connect"></a>
|
||||||
|
|
||||||
## connect(uuid, callback)
|
## connect(uuid, callback)
|
||||||
|
|
||||||
Connection to the service and retrieves the session identifier.
|
Connection to the service and retrieves the session identifier.
|
||||||
|
|
||||||
| Param | Type | Description |
|
| Param | Type | Description |
|
||||||
@ -76,6 +84,7 @@ Connection to the service and retrieves the session identifier.
|
|||||||
<a name="send"></a>
|
<a name="send"></a>
|
||||||
|
|
||||||
## send(uuid, text, callback)
|
## send(uuid, text, callback)
|
||||||
|
|
||||||
Sends a message to bot and returns a response.
|
Sends a message to bot and returns a response.
|
||||||
|
|
||||||
| Param | Type | Description |
|
| Param | Type | Description |
|
||||||
@ -85,6 +94,7 @@ Sends a message to bot and returns a response.
|
|||||||
| callback | <code>function</code> | Function handler |
|
| callback | <code>function</code> | Function handler |
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[](https://github.com/eslint/eslint)
|
[](https://github.com/eslint/eslint)
|
||||||
|
|
||||||
[MIT](LICENSE.md).
|
[MIT](LICENSE.md).
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "iii-client",
|
"name": "iii-client",
|
||||||
"version": "3.2.1",
|
"version": "3.2.2",
|
||||||
"description": "Simple API for communicating with the bot of the \"iii.ru\" service.",
|
"description": "Simple API for communicating with the bot of the \"iii.ru\" service.",
|
||||||
"homepage": "https://github.com/valentineus/iii-client",
|
"homepage": "https://github.com/valentineus/iii-client",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -7,7 +7,7 @@ import http from 'http';
|
|||||||
*/
|
*/
|
||||||
function connect(uuid, callback) {
|
function connect(uuid, callback) {
|
||||||
if (!isVerification(uuid)) {
|
if (!isVerification(uuid)) {
|
||||||
throw new Error('The variable \'uuid\' is not valid.');
|
throw new TypeError('The variable \'uuid\' is not valid.');
|
||||||
}
|
}
|
||||||
|
|
||||||
var pkg = createPackage(uuid, null);
|
var pkg = createPackage(uuid, null);
|
||||||
@ -22,7 +22,7 @@ function connect(uuid, callback) {
|
|||||||
*/
|
*/
|
||||||
function send(uuid, text, callback) {
|
function send(uuid, text, callback) {
|
||||||
if (!isVerification(uuid)) {
|
if (!isVerification(uuid)) {
|
||||||
throw new Error('The variable \'uuid\' is not valid.');
|
throw new TypeError('The variable \'uuid\' is not valid.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isString(text)) {
|
if (!isString(text)) {
|
||||||
@ -43,8 +43,8 @@ function forward(pkg, path, callback) {
|
|||||||
var query = {
|
var query = {
|
||||||
path: `/api/2.0/json/Chat.${path}`,
|
path: `/api/2.0/json/Chat.${path}`,
|
||||||
hostname: 'iii.ru',
|
hostname: 'iii.ru',
|
||||||
method: 'POST',
|
protocol: 'http:',
|
||||||
port: 80
|
method: 'POST'
|
||||||
};
|
};
|
||||||
|
|
||||||
var request = http.request(query, (response) => {
|
var request = http.request(query, (response) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user