
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
canhazdb-client
Advanced tools
A client to simplify making rest api calls by using database like functions.
You should create a server before trying to use the client.
const client = require('canhazdb-client');
const tls = {
key: fs.readFileSync('./certs/localhost.privkey.pem'),
cert: fs.readFileSync('./certs/localhost.cert.pem'),
ca: [ fs.readFileSync('./certs/ca.cert.pem') ],
requestCert: true /* this denys any cert not signed with our ca above */
};
const client = createClient('https://localhost:8063', { tls });
const document = await client.post('tests', { a: 1 });
const changed = await client.put('tests', { id: document.id }, { query: { b: 2 } });
const changedDocument = await client.getOne('tests', { query: { id: document.id } });
// Capture an event based on regex
// client.on('.*:/tests/.*', ...)
// client.on('.*:/tests/uuid-uuid-uuid-uuid', ...)
// client.on('POST:/tests', ...)
// client.on('DELETE:/tests/.*', ...)
// client.on('(PUT|PATCH):/tests/uuid-uuid-uuid-uuid', ...)
client.on('POST:/tests/.*', (path, collectionId, resourceId, pattern) => {
console.log(path) // === 'POST:/tests/uuid-uuid-uuid-uuid'
console.log(collectionId) // === 'tests'
console.log(resourceId) // === 'uuid-uuid-uuid-uuid'
console.log(pattern) // === 'POST:/tests/.*'
})
console.log( {
document, /* { a: 1 } */
changed, /* { changes: 1 } */
changedDocument, /* { b: 2 } */
})
client.get('tests', {
query: {
id: 'example-uuid-paramater'
}
});
client.count('tests', {
query: {
firstName: 'Joe'
}
});
client.get('tests', {
query: {
firstName: 'Joe'
},
limit: 10,
order: 'desc(firstName)'
});
client.post('tests', {
firstName: 'Joe'
});
client.put('tests', {
firstName: 'Joe'
});
client.put('tests', {
firstName: 'Zoe',
location: 'GB',
timezone: 'GMT'
}, {
query: {
location: 'GB'
}
});
client.patch('tests', {
timezone: 'GMT'
}, {
query: {
location: 'GB'
}
});
client.patch('tests', {
timezone: 'GMT'
}, {
query: {
location: 'GB'
}
});
client.delete('tests', {
query: {
id: 'example-uuid-paramater'
}
});
client.delete('tests', {
query: {
location: 'GB'
}
});
const lockId = await client.lock(['users']);
const lockId = await client.lock(['users']);
const newDocument = await client.post('users', {
name: 'mark'
}, {
lockId,
lockStrategy: 'wait' // optional: can be 'fail' or 'wait'. default is 'wait'.
});
await client.unlock(lockId);
This project is licensed under the terms of the AGPL-3.0 license.
FAQs
Talk to a restful api using database like functions.
We found that canhazdb-client 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.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.