
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
ts-odata-v4-server
Advanced tools
TS OData V4 server for node.js and Typescript based on odata-v4-server
@odata.controller(ProductsController, true)
export class Server extends ODataServer {}
export class ProductsController extends ODataController {
/**
* Get All products
* @param query
* @returns products
*/
@odata.GET
async select(@odata.query $query: ODataQuery): Promise<Product[]> {
const db = await connect();
const query = createQuery($query);
const { rows } = await db.query(query.from('"Products"'), query.parameters);
return convertResults(rows);
}
/**
* Get one product by id
* @param key
* @param query
* @returns
*/
@odata.GET
async selectOne(
@odata.key key: number,
@odata.query query: ODataQuery
): Promise<Product> {
const db = await connect();
const sqlQuery = createQuery(query);
const { rows } = await db.query(
`SELECT ${sqlQuery.select} FROM "Products"
WHERE "Id" = $${
sqlQuery.parameters.length + 1
} AND
(${sqlQuery.where})`,
[...sqlQuery.parameters, key]
);
return convertResults(rows)[0];
}
}
import { Server } from "./server";
require("dotenv").config();
// Setup metadata schema
Server.$metadata(your_schema_file);
// Start ODATA server
const port = parseInt(process.env.PORT, 10) || 3000;
Server.create("/odata", port).addListener("listening", () => {
console.log(`Odata server listening on port ${port} 🚀`);
});
Path : http://localhost:3000/odata/Categories
Method : GET
{
"@odata.context": "http://localhost:3000/odata/$metadata#Categories",
"value": [
{
"Id": 1,
"Name": "Beverages",
"Description": "Soft drinks"
},
{
"Id": 2,
"Name": "Grains/Cereals",
"Description": "Breads"
},
{
"Id": 3,
"Name": "Meat/Poultry",
"Description": "Prepared meats"
},
{
"Id": 4,
"Name": "Produce",
"Description": "Dried fruit and bean curd"
},
{
"Id": 5,
"Name": "Seafood",
"Description": "Seaweed and fish"
},
{
"Id": 6,
"Name": "Condiments",
"Description": "Sweet and savory sauces"
},
{
"Id": 7,
"Name": "Dairy Products",
"Description": "Cheeses"
},
{
"Id": 8,
"Name": "Confections",
"Description": "Desserts"
}
]
}
FAQs
TS OData V4 Server
The npm package ts-odata-v4-server receives a total of 5 weekly downloads. As such, ts-odata-v4-server popularity was classified as not popular.
We found that ts-odata-v4-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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 found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.