
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@aller/labrador-utils
Advanced tools
yarn add @aller/labrador-utils
or
npm install @aller/labrador-utils
const { api } = require('labrador-utils')
const labApi = api({ base: 'http://api.secret.labrador.api.lol', site_id: 1 })
labApi.getArticleById({ id: 9999999, args... }) // {Article}
labApi.getArticlesByTags({ tags:['test', 'bil'], args... }) // [{Article}...]
labApi.getArticlesByTag({ tag: 'test', args... }) // [{Article}...]
labApi.getArticlesBySection({ section: 'mat', args... }) // [{Article}...]
labApi.getFrontPageById({ id: 9999999, args... }) // { FrontPage }
labApi.getFragment({ id: 9999999, args... }, ?clean) // Returns HTML string. If clean is provided, the resulting HTML is parsed throuhg parse5 to ensure valid markup.
Article-based high level methods also have query-specific options e.g:
labApi.getArticleById({
isFeatured: true,
visibility_status: 'P'
})
labApi.getQuery('/front', { query: 'id:999999', args... }).get() // { result: [{ FrontPage }...] }
labApi.getFrontPage({ query: 'id:9999999', args... }).getResult() // [{ FrontPage }...]
labApi.getArticles({ query: 'tag:test', args... }).getFrist() // { Article }
All base methods have 3 request methods
get() -> { result: [ { ENTITY }...] }
getResult() -> [ {ENTITY }... ]
getFirst() -> { ENTITY }
The base methods use the queryBuilder for parsing of the query-parameter. The queryBuilder takes nested JS objects/arrays as input and generates a query string as output.
labApi.getArticles({
query: [{ tag: ['nyheter', 'bil'] }, { 'review_score': '*' }],
}).getResult()
// query: (tag:(nyheter AND bil) AND review_score:*)
// The underlying queryBuilder method can also be directly accessed:
labApi.queryBuilder([{ tags: ['hello', { wat: ['test1', ['hello', 'hello2'], 'OR'] }] }])
// returns the string: '(tags:(hello AND wat:(test1 OR (hello AND hello2))))'
Concepts:
['nyheter', 'bil'] // -> (nyheter AND bil)
['nyheter', 'bil', 'OR'] // -> (nyheter OR bil), the 'OR' keyword needs to be the last el. of the array.
{ tag: ['nyheter', 'bil', 'OR']} // -> (tag:(nyheter OR bil))
// And any nested combination of these three concepts
All additional args. on all methods, are sent as query params, e.g:
labApi.getArticlesByTags({
tags: ['test', 'bil'],
limit: 5,
start: 5,
order: 'desc',
orderBy: 'published'
})
Defaults are found here
FAQs
Labrador utils
The npm package @aller/labrador-utils receives a total of 0 weekly downloads. As such, @aller/labrador-utils popularity was classified as not popular.
We found that @aller/labrador-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.