ericmunn / node-odata Goto Github PK
View Code? Open in Web Editor NEWNode service for providing odata batch operations
Node service for providing odata batch operations
Getting an error after adding package because of a triple slash reference to the node module.
///<reference path="./../node_modules/@types/node/index.d.ts"/>
This is because the typings are in the dist folder and the relative path is incorrectly defined.
Perhaps you could add it to the tsconfig.json (compilerOptions/typeRoots) configuration section.
https://github.com/EricMunn/node-odata/blob/master/src/OData3BatchService.ts#L1
When an error response is returned with a content type of application/json, return the error as a parsed object rather than a string.
--batchresponse_25e859c1-cec7-4431-aa16-bd3ebf09b51c
Content-Type: multipart/mixed; boundary=changesetresponse_acb5cf28-57c2-494e-bc60-b0cc9e5a7f84
--changesetresponse_acb5cf28-57c2-494e-bc60-b0cc9e5a7f84
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 404 Not Found
Content-ID: 1
X-Content-Type-Options: nosniff
DataServiceVersion: 3.0;
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
{"odata.error":{"code":"","message":{"lang":"en-US","value":"{\"ErrorCode\":404,\"ComponentErrors\":[{\"ComponentDescription\":\"Data Service Framework\",\"ErrorDetails\":[{\"ErrorCode\":404,\"ErrorDescription\":\"DataServiceException\",\"ErrorDetails\":[\"Resource not found for the segment 'NonExistentEntity'.\"]}]}]}"}}}
--changesetresponse_acb5cf28-57c2-494e-bc60-b0cc9e5a7f84--
--batchresponse_25e859c1-cec7-4431-aa16-bd3ebf09b51c--
return as
{
"odata.error": {
"code": "",
"message": {
"lang": "en-US",
"value": "{\"ErrorCode\":404,\"ComponentErrors\":[{\"ComponentDescription\":\"Data Service Framework\",\"ErrorDetails\":[{\"ErrorCode\":404,\"ErrorDescription\":\"DataServiceException\",\"ErrorDetails\":[\"Resource not found for the segment 'NonExistentEntity'.\"]}]}]}"
}
}
}
The add headers method takes in an object and allows a user to use a non index type.
The current signature.
addHeaders(headers:Object)
Proposed signature.
addHeaders(headers:{ [name: string]: string })
Usage:
batch.addHeaders( { "Foo": "Bar" } );
https://github.com/EricMunn/node-odata/blob/master/src/OData3Batch.ts#L73
I would like to be able to add the 'Prefer: return-no-content' header, however, the request object contains no way to do this.
https://github.com/EricMunn/node-odata/blob/master/src/OData3Request.ts#L23
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.