Gathering detailed insights and metrics for lexx-odata-query-builder
Gathering detailed insights and metrics for lexx-odata-query-builder
Gathering detailed insights and metrics for lexx-odata-query-builder
Gathering detailed insights and metrics for lexx-odata-query-builder
npm install lexx-odata-query-builder
Typescript
Module System
Node Version
NPM Version
TypeScript (66.08%)
JavaScript (33.92%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
63 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 10, 2021
Latest Version
1.20.0
Package Id
lexx-odata-query-builder@1.20.0
Unpacked Size
68.52 kB
Size
15.53 kB
File Count
20
NPM Version
8.19.4
Node Version
16.20.2
Published on
Sep 22, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
1npm i lexx-odata-query-builder
1const o = new QueryBuilder('http://site.com/odata/users')
2o.build()
Output
http://site.com/api/users
Or with custom query params
1const o = new QueryBuilder('http://site.com/odata/users')
2o.querySet('lang', 'en')
3o.build()
Output
http://site.com/api/users?lang=en
Use order
method to add order query parameters
Note:
order
method has an aliasorderby
1const o = new QueryBuilder('/users') 2o.order(new QueryOrder('name1')).build()
Output
http://site.com/odata/users?$orderby=name1 asc
Also, you can combine several order conditions
1const o = new QueryBuilder('/users') 2o.order(new QueryOrder('name1')).order(new QueryOrder('name2', QueryOrderDirection.DESC)) 3o.build()
Output
/users?$orderby=name1 asc,name2 desc
Use expand
method to add expand query parameter
1const o = new QueryBuilder('/users') 2o.expand('company').build()
Output
/users?$expand=company
Or combine several expand parameters
1const o = new QueryBuilder('/users') 2o.expand('company').expand('jobtitle').build()
Output
/users?$expand=company,jobtitle
To add counter to expanding parameter, add true
as second parameter of expand
method
1const o = new QueryBuilder('/users') 2o.expand('emails', true).build()
Output
/users?$expand=company($count=true)
For limiting returned data, use limit
and offset
methods
Note:
limit
has an aliastop
offset
has aliasesskip
andshift
1const o = new QueryBuilder('/users') 2o.top(7).skip(4).build()
Output
/users?$top=7&$skip=4
To limit output data by page, use page
method.
1const o = new QueryBuilder('/users') 2o.page(3).build()
Output
/users?$top=10&$skip=20
By default, it has 10 records per page, but you free to change in via QueryBuilder configuration.
1const o = new QueryBuilder('/users', {rowsPerPage: 5}) 2o.page(3).build()
Output
/users?$top=5&$skip=10
Use filter
method to add constrains. QueryBuilder accept only one filter, but you free to use and
and or
methods of QueryFilter to combine them together.
1const oFilter = new QueryFilter('gender', 'f') 2oFilter.and('age', 16, QueryFilterSign.GT) 3const o = new QueryBuilder('/users') 4o.filter(oFilter).build()
Output
/users?$filter=gender eq f and age gt 16
count
method will add $count
suffix to url
1const o = new QueryBuilder('/users') 2o.count().build()
Output
/users/$count
Of course, you can use count
with filter
for example.
1const oFilter = new QueryFilter('gender', 'f') 2oFilter.and('age', 16, QueryFilterSign.GT) 3const o = new QueryBuilder('/users') 4o.filter(oFilter).count().build()
Output
/users/$count?$filter=gender eq f and age gt 16
ID is primary key of database. Use id
method to create oData request for single entity.
1const o = new QueryBuilder('/users') 2o.id(4).build()
Output
/users(4)
Use select
method to constrain returned fields
1const o = new QueryBuilder('/users') 2o.select(['id','name']).build()
Output
/users?$select=id,name
Use count
method to get request for count value
1const o = new QueryBuilder('/users') 2o.count()
Output `/users/$count
Other-hand, if you want to make request of data with total count, you can use inlineCount
method
Use count
method to get request for count value
1const o = new QueryBuilder('/users')
2o.inlineCount()
Output `/users?$count=true
Getting the file content is extra path. It will not make effect to real oData server, but you can use it in development as ideology.
To get file content, call asFileContent
method
1const o = new QueryBuilder('/files') 2o.id(4).asFileContent().build()
Output
/files(4)/_file
Sometimes needed to get base64 encoded content. Use asFileContentBase64
method to generate path
1const o = new QueryBuilder('/files') 2o.id(4).asFileContentBase64().build()
Output
/files(4)/_file64
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More