Comparing version 0.0.1-beta.2 to 1.0.0
@@ -9,4 +9,8 @@ All notable changes to this project will be documented in this file. | ||
## [1.0.0] - 2020-03-15 | ||
### Changed | ||
- code is now in native ESM with CommonJS fallback | ||
## [0.0.1-beta.1] - 2020-02-27 | ||
### Added | ||
- first version |
@@ -1,55 +0,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _dist = _interopRequireDefault(require("api-reach/dist")); | ||
var _mapValues = _interopRequireWildcard(require("bottom-line-utils/mapValues")); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
class AbuseIPDB { | ||
/** | ||
* @param {string} apiKey - AbuseIPDB api key | ||
*/ | ||
constructor(apiKey) { | ||
this._api = new _dist.default({ | ||
base: "https://api.abuseipdb.com/api/v2/", | ||
headers: { | ||
Key: apiKey, | ||
Accept: "application/json" | ||
} | ||
}); | ||
} | ||
/** | ||
* @param {string} ipAddress - ipv4 or ipv6 to check | ||
* @param {number} [maxAgeInDays] - how far back in time to fetch reports | ||
* @param {boolean} [verbose] - if reports array should be returned as well with basic data | ||
* @returns {Promise} | ||
*/ | ||
check(ipAddress, maxAgeInDays, verbose) { | ||
const params = (0, _mapValues.default)({ | ||
ipAddress, | ||
maxAgeInDays, | ||
verbose | ||
}, value => { | ||
if (!value) { | ||
return _mapValues.REMOVE; | ||
} | ||
return value; | ||
}); | ||
return this._api.get("/check", params).then(r => r.body.data); | ||
} | ||
} | ||
var _default = AbuseIPDB; | ||
exports.default = _default; | ||
const m = require("./__index.js"); | ||
const def = m.default; | ||
module.exports = def || {}; | ||
Object.keys(m).filter(key => key !== "default").forEach(key => { | ||
module.exports[key] = m[key]; | ||
}); |
{ | ||
"name": "abuseipdb", | ||
"version": "0.0.1-beta.2", | ||
"main": "src/index.js", | ||
"version": "1.0.0", | ||
"repository": "https://github.com/dzek69/abuseipdb.git", | ||
@@ -9,27 +8,41 @@ "author": "Jacek Nowacki", | ||
"scripts": { | ||
"test": "cross-env NODE_ENV=testing mocha 'src/**/*.spec.js'", | ||
"docs": "node build-scripts/docs && jsdoc -r src README.md -t node_modules/docdash -d ./docs -u ./tutorials -c jsdoc.json && node build-scripts/docs.after", | ||
"transpile": "node build-scripts/transpile && babel src -d dist --ignore **/*.spec.js*", | ||
"prepublishOnly": "npm run lint && npm run test && npm run docs", | ||
"prepack": "npm run transpile", | ||
"lint": "cross-env eslint --report-unused-disable-directives 'src/**/*.js' 'src/*.js'", | ||
"lint:fix": "npm run lint -- --fix" | ||
"test": "cross-env NODE_ENV=testing mocha --require ./test/bootstrap.cjs 'src/**/*.spec.mjs'", | ||
"docs": "node build-scripts/docs.mjs && jsdoc -r src README.md -t node_modules/docdash -d ./docs -u ./tutorials -c jsdoc.json && node build-scripts/docs.after.mjs", | ||
"transpile": "node build-scripts/transpile.mjs && babel src -d dist --ignore **/*.spec.mjs && node build-scripts/transpile.after.mjs", | ||
"prepublishOnly": "yarn lint && yarn test && yarn docs", | ||
"prepack": "yarn transpile", | ||
"lint": "cross-env eslint --report-unused-disable-directives 'src/**/*.mjs' 'src/*.mjs'", | ||
"lint:fix": "yarn lint --fix" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "src/index.mjs", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"default": "./src/index.mjs" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.5.5", | ||
"@babel/core": "^7.5.5", | ||
"@babel/polyfill": "^7.4.4", | ||
"@babel/preset-env": "^7.5.5", | ||
"@babel/register": "^7.5.5", | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.8.7", | ||
"@babel/polyfill": "^7.8.7", | ||
"@babel/preset-env": "^7.8.7", | ||
"@babel/register": "^7.8.6", | ||
"@dzek69/eslint-config-base": "^1.0.1", | ||
"babel-plugin-module-extension": "^0.1.1", | ||
"babel-plugin-rewire": "^1.2.0", | ||
"cross-env": "^5.2.0", | ||
"docdash": "^1.1.1", | ||
"eslint": "^6.2.2", | ||
"fs-extra": "^7.0.1", | ||
"husky": "^3.0.4", | ||
"cross-env": "^7.0.2", | ||
"docdash": "^1.2.0", | ||
"eslint": "^6.8.0", | ||
"fs-extra": "^8.1.0", | ||
"husky": "^4.2.3", | ||
"jsdoc": "^3.6.3", | ||
"mocha": "^6.2.0", | ||
"mocha": "^6.2.2", | ||
"must": "^0.13.4" | ||
}, | ||
"dependencies": { | ||
"api-reach": "^0.7.0", | ||
"bottom-line-utils": "^0.8.0", | ||
"node-fetch": "^3.0.0-beta.4" | ||
}, | ||
"husky": { | ||
@@ -41,9 +54,5 @@ "hooks": { | ||
"libraryTemplate": { | ||
"version": "1.9.0" | ||
}, | ||
"dependencies": { | ||
"api-reach": "^0.5.0", | ||
"bottom-line-utils": "^0.6.3", | ||
"node-fetch": "^2.6.0" | ||
"version": "2.0.8", | ||
"fixDefaultForCommonJS": true | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1217520
42
982
1
16
+ Addedapi-reach@0.7.0(transitive)
+ Addedbetter-custom-error@3.0.1(transitive)
+ Addedbottom-line-utils@0.8.0(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedoop-timers@3.0.1(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removedapi-reach@0.5.0(transitive)
- Removedbetter-custom-error@1.0.0(transitive)
- Removedbottom-line-utils@0.6.3(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedoop-timers@1.0.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatedapi-reach@^0.7.0
Updatedbottom-line-utils@^0.8.0
Updatednode-fetch@^3.0.0-beta.4