From 27248e6cee57222a555938058f1da65c8ac35181 Mon Sep 17 00:00:00 2001 From: caioagiani Date: Sun, 21 Feb 2021 22:48:46 -0300 Subject: [PATCH] fix: build package --- .eslintrc.js | 1 + README.md | 6 +++--- dist/index.js | 4 ++-- example.js | 2 +- package.json | 2 +- src/index.js | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dc64dca..9a3b218 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,7 @@ module.exports = { indent: ['error', 2], 'no-undef': 0, 'no-console': 0, + 'import/prefer-default-export': 0, 'linebreak-style': ['error', 'unix'], 'no-unused-vars': ['error', { argsIgnorePattern: 'next' }], 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], diff --git a/README.md b/README.md index 99d6b47..6f61d55 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ Pacote: `npm i mobizon-node` ou `yarn add mobizon-node` ## Configuração: ```js -const mobizon = require('mobizon-node'); +const { mobizon } = require('mobizon-node'); mobizon.setConfig({ apiServer: 'https://api.mobizon.com.br', - apiKey: process.env.API_KEY, + apiKey: 'br01xxxxxx', format: 'json', }); ``` @@ -64,7 +64,7 @@ Confira em [docs](https://github.com/caioagiani/mobizon-node/blob/master/docs) t /** Enviar SMS */ const sendSms = await mobizon.sendSms({ - recipient: process.env.NUMBER, + recipient: '5511900000000', from: '', text: 'SMS sent by Mobizon.', }); diff --git a/dist/index.js b/dist/index.js index 059e991..dd02edc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3,7 +3,7 @@ var _balance = require('./structures/balance'); var _balance2 = _interopRequireD var _shortlink = require('./structures/shortlink'); var _shortlink2 = _interopRequireDefault(_shortlink); var _sms = require('./structures/sms'); var _sms2 = _interopRequireDefault(_sms); -exports. default = { + const mobizon = { environment: _environment2.default, setConfig({ apiServer, apiKey, format }) { _environment2.default.apiKey = apiKey; @@ -20,4 +20,4 @@ exports. default = { deleteShort: (data) => _shortlink2.default.delete(data), updateShort: (data) => _shortlink2.default.update(data), getStatsShort: (data) => _shortlink2.default.getstats(data), -}; +}; exports.mobizon = mobizon; diff --git a/example.js b/example.js index 7ae1582..dafda7d 100644 --- a/example.js +++ b/example.js @@ -1,6 +1,6 @@ import 'dotenv/config'; -import mobizon from 'mobizon-node'; +import { mobizon } from 'mobizon-node'; mobizon.setConfig({ /** Endpoint do serviço. */ diff --git a/package.json b/package.json index dfc9a10..d60774b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobizon-node", - "version": "0.3.0", + "version": "0.3.1", "description": "Biblioteca NodeJS para trabalhar com os serviços Mobizon API", "readmeFilename": "README.md", "main": "dist/index.js", diff --git a/src/index.js b/src/index.js index 5e826ef..0d08b34 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,7 @@ import balance from './structures/balance'; import short from './structures/shortlink'; import sms from './structures/sms'; -export default { +export const mobizon = { environment, setConfig({ apiServer, apiKey, format }) { environment.apiKey = apiKey;