
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
bridge-odata
Advanced tools
npm install restly/odata-js-sdk
var bridge = require('odata-js-sdk')
// Vendor defaults to `test`
var bridge = new BridgeAPI(ACCESS_TOKEN, [vendor])
// Fetches a list of Properties, provided by the vendor
bridge
.Properties()
.exec()
Returns a new instance of BridgeAPI. Requires an API token and optionally set the vendor (the MLS data source), defaults to test
.
Returns a single entity if a key is specified. If a key is not specified all related entities are returned.
Returns all media.
The number of results from the most recent query, set to 0 before and during query execution.
Paginates to the next page of results.
Paginates to the previous page of results.
A simple example of an autocomplete can be seen here, The SDK part of the code looks like:
var BridgeAPI = require('./odata-js-sdk')
const Bridge = new BridgeAPI(BridgeAPI.TEST_TOKEN)
function autocomplete (address) {
let prim = Bridge.Properties()
.$select('','')
.$filter({
left: 'UnparsedAddress',
comparator: 'startswith',
right: address
})
.exec()
return prim
}
Filtered queries can get complex however they are fairly powerful. One can write a JS object literal as the query that will map to a string query. e.g.
{right: 'a', op: 'eq', left: 'b'} => 'a eq b'
{right: 'a', op: 'intersect', left: 'b'} => 'geo.intersect(a,b)'
The full list of operations can be found in the `src/lib/maps.js' file, but are not limited to:
Name | Operation | Description |
---|---|---|
eq | 'a eq b' | checks if a == b |
neq | 'a neq b' | checks if a != b |
lt | 'a lt b' | checks if a < b |
gt | 'a gt b' | checks if a > b |
ge | 'a ge b' | checks if a >= b |
le | 'a le b' | checks if a <= b |
The any
and all
operations are referred to and act as lambdas in the OData syntax.
In the event that one is aware of an operation that currently doesn't exist within the set of hardcoded operations they can create their own. With this syntax the object literal attributes must have the same name as the operation function parameters.
// Valid!
{
right: 'Joe',
left: '"The greatest person ever"',
op: (right, left) => `${right} eq ${left}`
} => 'Joe eq "The greatest person ever"'
// Invalid! Will throw error
{
right: 'Joe',
left: '"The greatest person ever"',
op: (a,b) => `${a} eq ${b}`
} => ERROR
FAQs
Bridge API OData JS SDK
The npm package bridge-odata receives a total of 1 weekly downloads. As such, bridge-odata popularity was classified as not popular.
We found that bridge-odata 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
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.