arbase-crud
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "arbase-crud", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Arbase-crud is a package to expose a CRUD-like interface from an arbase API config", | ||
"main": "src/compile/index.js", | ||
"main": "src/runtime/index.js", | ||
"scripts": { | ||
@@ -14,3 +14,3 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
], | ||
"runtime": "src/runtime/index.js", | ||
"compile": "src/compile/index.js", | ||
"author": "Maciej Krüger <mkg20001@gmail.com>", | ||
@@ -25,3 +25,7 @@ "license": "MPL-2.0", | ||
}, | ||
"homepage": "https://github.com/mkg20001/arbase-crud#readme" | ||
"homepage": "https://github.com/mkg20001/arbase-crud#readme", | ||
"dependencies": { | ||
"@hapi/boom": "^8.0.1", | ||
"@hapi/joi": "^16.1.5" | ||
} | ||
} |
'use strict' | ||
const fs = require('fs') | ||
const path = require('path') | ||
const template = String(fs.readFileSync(path.join(__dirname, 'template.js'))) | ||
function compileEndpoint ({prefix}, entry, helper) { | ||
if (!entry) return '' | ||
const name = (entry.ns ? entry.ns + '.' : '') + entry.name | ||
return `crud({ | ||
server, | ||
name: ${JSON.stringify(name)}, | ||
entry: ${helper.stringifyEntry(entry)}, | ||
prefix: ${JSON.stringify(prefix)}, | ||
middleware: {}, | ||
arweave | ||
})` | ||
} | ||
function compile (data, helper) { | ||
let insert = data.entries.map(entry => | ||
compileEndpoint({}, entry, helper)).join('\n') | ||
return template.replace('/* INSERT */', insert) | ||
} | ||
module.exports = compile |
'use strict' | ||
module.exports = (def, a) => { | ||
module.exports = { | ||
crud: require('./crud') | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
7338
6
203
2
1
+ Added@hapi/boom@^8.0.1
+ Added@hapi/joi@^16.1.5
+ Added@hapi/address@2.1.4(transitive)
+ Added@hapi/boom@8.0.1(transitive)
+ Added@hapi/formula@1.2.0(transitive)
+ Added@hapi/hoek@8.5.1(transitive)
+ Added@hapi/joi@16.1.8(transitive)
+ Added@hapi/pinpoint@1.0.2(transitive)
+ Added@hapi/topo@3.1.6(transitive)