
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
batch-odata
Advanced tools
Node module to provide OData batch services (currently supports v3 only)
npm install batch-odata --save
Create an instance of the batch service. Create a batch; create a changeset; create and add requests to a batch or changeset; submit batch.
Requests and changesets are submitted in the order they are added.
Create an instance of the batch service:
var service = new odata.OData3BatchService();
Create a batch: createBatch(endpointUrl:string)
var batch = service.createBatch("https://YourBatchEndpoint.com/$batch");
Create a request: createRequest(method:string,url:string,data:{},contentId:string)
var request = service.createRequest("GET", "SomeEntity('EntityKey')", null, null);
Create a request w/headers:
var request = service.createRequest("GET", "SomeEntity('EntityKey')", null, null,{"Prefer":"return-no-content"});
Add headers to an existing request:
request.addHeaders({"Prefer":"return-no-content"});
Add the request to the batch:
batch.addRequest(request);
Create a changeset: createChangeset();
var changeset = service.createChangeset();
Add a request to a changeset:
changeset.addRequest(request);
Simple batch with one GET operation
var odata = require("batch-odata");
var service = new odata.OData3BatchService();
var batch = service.createBatch("https://YourBatchEndpoint.com/$batch");
var request = service.createRequest("GET", "SomeEntity('EntityKey')", null, null);
batch.addRequest(batch);
service.submitBatch(batch);
.then(function (responses) {
responses.forEach(function (response) {
//Do something with response
});
};
Batch with changeset
var odata = require("batch-odata");
var service = new odata.OData3BatchService();
var batch = service.createBatch("https://YourBatchEndpoint.com/$batch");
var changeset = service.createChangeset();
var request = service.createRequest("POST", "YourEntity", {"foo":"bar"}, "1");
changeset.addRequest(request);
batch.addChangeset(changeset);
service.submitBatch(batch)
.then(function (responses) {
responses.forEach(function (response) {
//Do something with response
});
};
npm run dist
Compiles, builds to dist folder, increments version patch level and creates npm package file.
npm run compile:dev
Cleans src and test folders of .js and .js.map files and recompiles.
npm test
Starts a single run of the test suite.
FAQs
Node services for odata
We found that batch-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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.