New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apicco-lib

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apicco-lib - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

README.md

44

build.js

@@ -22,19 +22,23 @@ const path = require('path');

} = {}) {
function log(msg = '') {
if (verbose) {
console.log('[Apicco]', msg);
}
}
const router = new Router();
router
.prefix(prefix)
.use(accepts);
router.use(accepts);
const api = {};
const resources = require('require-directory')(
module,
path.resolve(apiPath),
{
exclude: /(\.test\.)|(index\.js)/
}
);
const fullApiPath = path.resolve(apiPath);
for (let r in resources) {
log(`API folder set to "${fullApiPath}"`);
const resources = require('require-directory')(module, fullApiPath, {
exclude: /(\.test\.)|(index\.js)/
});
for (const r in resources) {
if (!resources.hasOwnProperty(r)) {

@@ -46,3 +50,3 @@ continue;

for (let a in actions) {
for (const a in actions) {
if (!actions.hasOwnProperty(a)) {

@@ -68,3 +72,3 @@ continue;

for (let param in validate) {
for (const param in validate) {
if (!validate.hasOwnProperty(param)) {

@@ -74,6 +78,8 @@ continue;

const { isJoi = true, _flags = {}} = validate[param];
const { isJoi = true, _flags = {} } = validate[param];
if (!isJoi) {
throw new Error(`Invalid Joi validation for ${actionName} action: ${param}.`);
throw new Error(
`Invalid Joi validation for ${actionName} action: ${param}.`
);
}

@@ -88,10 +94,8 @@

router.post(`/${action}`, compose(middlewares));
router.post(path.join(prefix, action), compose(middlewares));
if (verbose) {
console.log(`Loaded: ${r}.${a} action`);
}
log(`Loaded "${r}.${a}" action`);
}
router.get('/discovery', ctx => {
router.get(path.join(prefix, 'discovery'), (ctx) => {
ctx.status = 200;

@@ -98,0 +102,0 @@ ctx.body = api;

{
"name": "apicco-lib",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "index.js",
"scripts": {},
"repository": {

@@ -23,13 +22,12 @@ "type": "git",

"homepage": "https://github.com/sokratisvidros/apicco#readme",
"engines": {
"node": "~8.11.4"
},
"dependencies": {
"boom": "^7.2.0",
"inflection": "^1.12.0",
"koa-compose": "^4.0.0",
"koa-compose": "^4.1.0",
"koa-joi-validate": "^0.5.1",
"koa-router": "^7.4.0"
},
"devDependencies": {},
"engines": {
"node": "~8.11.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc