diff options
-rw-r--r-- | .travis.yml | 74 | ||||
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/index.js | 8 |
5 files changed, 63 insertions, 35 deletions
diff --git a/.travis.yml b/.travis.yml index eb21cb9..04657ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,47 +1,61 @@ language: node_js node_js: - - "8" - - "7" - - "6" - - "5" - - "4" + - "8" + - "7" + - "6" + - "5" + - "4" os: - - linux - - osx + - linux + +services: + - docker notifications: - email: - - "info@valentineus.link" + email: + - "info@valentineus.link" before_install: - - npm install --global nyc - - npm install --global codacy-coverage + - npm install --global nyc + - npm install --global codacy-coverage install: - - npm install + - npm install script: - - npm run check - - nyc npm run test - - nyc report --reporter=lcov + - npm run check + - nyc npm run test + - nyc report --reporter=lcov after_success: - - nyc report --reporter=lcov - - cat ./coverage/lcov.info | codacy-coverage + - nyc report --reporter=lcov + - cat ./coverage/lcov.info | codacy-coverage jobs: - include: - - stage: deploy - node_js: "8" - os: "linux" - before_deploy: - - git stash --all - - npm install - - npm run build - deploy: - provider: npm - skip_cleanup: true - email: "info@valentineus.link" - api_key: $NPM_PROJECT_TOKEN + include: + stage: deploy + node_js: "8" + os: "linux" + before_deploy: + - git stash --all + - npm install + - npm run build + - npm pack + deploy: + - provider: npm + skip_cleanup: true + 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
\ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 517f010..441d36e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # 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) Features: - Minimize the published code. @@ -1,4 +1,6 @@ # III Client + +[![GitHub Release](https://img.shields.io/github/release/valentineus/simple-container.svg)](https://github.com/valentineus/simple-container/releases) [![NPM](https://img.shields.io/npm/v/iii-client.svg)](https://www.npmjs.com/package/iii-client) [![Build Status](https://travis-ci.org/valentineus/iii-client.svg?branch=master)](https://travis-ci.org/valentineus/iii-client) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/81b2fdc2f5dd42a6bdc8fdb43640b282)](https://www.codacy.com/app/valentineus/iii-client) @@ -8,12 +10,14 @@ Simple API for communicating with the bot of the \"iii.ru\" service. ## Features + - Multiplatform library. - A small and light library. - Getting session ID. - Sending and receiving messages. ## Installation + NodeJS: ```bash npm install --save iii-client @@ -27,6 +31,7 @@ Browser: ``` ## Using + An example of a connection, receiving session identification and sending a bot message: ```javascript import { connect, send } from 'iii-client'; @@ -47,7 +52,9 @@ send(cuid, text, (answer) => { ``` ## API + ## Functions + <dl> <dt> <a href="#connect">connect(uuid, callback)</a> @@ -66,6 +73,7 @@ send(cuid, text, (answer) => { <a name="connect"></a> ## connect(uuid, callback) + Connection to the service and retrieves the session identifier. | Param | Type | Description | @@ -76,6 +84,7 @@ Connection to the service and retrieves the session identifier. <a name="send"></a> ## send(uuid, text, callback) + Sends a message to bot and returns a response. | Param | Type | Description | @@ -85,6 +94,7 @@ Sends a message to bot and returns a response. | callback | <code>function</code> | Function handler | ## License + [![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/eslint/eslint) [MIT](LICENSE.md). diff --git a/package.json b/package.json index 82fc8a9..d1e3fd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iii-client", - "version": "3.2.1", + "version": "3.2.2", "description": "Simple API for communicating with the bot of the \"iii.ru\" service.", "homepage": "https://github.com/valentineus/iii-client", "license": "MIT", diff --git a/src/index.js b/src/index.js index ea2e14a..4120ce2 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ import http from 'http'; */ function connect(uuid, callback) { 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); @@ -22,7 +22,7 @@ function connect(uuid, callback) { */ function send(uuid, text, callback) { if (!isVerification(uuid)) { - throw new Error('The variable \'uuid\' is not valid.'); + throw new TypeError('The variable \'uuid\' is not valid.'); } if (!isString(text)) { @@ -43,8 +43,8 @@ function forward(pkg, path, callback) { var query = { path: `/api/2.0/json/Chat.${path}`, hostname: 'iii.ru', - method: 'POST', - port: 80 + protocol: 'http:', + method: 'POST' }; var request = http.request(query, (response) => { |