
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Generates an optimized SDK from a RAML specification. Works with modern browsers and node.
Install with: npm install -S caraml
or yarn add caraml
import caraml from 'caraml'
// ---------- OPTIONS ----------
const options = {
// Path to root RAML file
apiPath: './api.raml',
// Parameters in base URI - version is auto-included
baseUriParameters: {
region: 'se01'
},
// Headers to send with every request unless overridden
defaultHeaders: {
Authorization: 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
},
// Prefix on resources when naming collisions occur
overridePrefix: '$'
}
// ---------- RESOURCES ----------
const { resources } = caraml(options)
// The resources object contains the top-level RAML resources (lower cased)
const { users } = resources
// Nested resources are properties of the parent resource
users.me // = /users/me
// Add uri-parameters by calling the resource with parameters
users(42) // = /users/42
users({ id: 42 }) // = /users/42 (route is /users/{id})
users({ username: 'alladin' }) // = /users/alladin (route is /users/{username})
// Use above in combination to reach any resource
users(42).messages(1).attachments // = /users/42/messages/1/attachments
// ---------- METHODS ----------
// Methods are functions that return promises
const query = 'query=string' || { query: 'parameters' }
const data = { json: 'data' }
// GET
users.get(query, options)
users.find(query, options)
// POST
users.post(data, query, options)
users.create(data, query, options)
// PUT
users.put(data, query, options)
users.update(data, query, options)
// PATCH
users.patch(data, query, options)
// DELETE
users.delete(query, options)
users.remove(query, options)
// Methods are available on resources according to spec
users(42).messages.post(data) // = POST /users/42/messages
// Prefix nested resources with overridePrefix when collisions occur
users(42).$find.find(query) // = GET /users/42/find?query=string
users(42).find(query) // = GET /users/42?query=string
const message = { text: 'Brevity is the soul of wit' }
async function spreadMessage () {
const allUsers = await users.find()
for (let user of allUsers) {
await users(user.id).messages.create(message)
}
}
function spreadMessage () {
return users.find().then(allUsers => {
allUsers.reduce((promise, user) => {
return promise.then(() => users(user.id).messages.create(message))
}, Promise.resolve())
})
}
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
FAQs
Generate SDK from RAML documentation
The npm package caraml receives a total of 0 weekly downloads. As such, caraml popularity was classified as not popular.
We found that caraml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.