Code Monkey home page Code Monkey logo

n-odata-server's People

Contributors

htammen avatar jhamel avatar johannesrue avatar renanwilliam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

n-odata-server's Issues

Make it possible to integrate n-odata-server as middleware in a loopback application

The preferred way to integrate modules like n-odata-server into loopback applications is via middleware.json. Currently the integration is done via component-config.json and defining routes internally by n-odata-server.
It should be possible to use the recommended way via middleware.json cause this allows a more fine grained definition of when the n-odata-server will be invoked during the processing of a request.

DEV-ISSUE: Fix problem with xmlbuilder typescript error

TypeScript creates an error cause the typings type definition (v0.8) does not match the used xmlbuilder version (v0.4.1).
Update to newest xmlbuilder version.

Error is:

 Error:(134, 7) TS2345: Argument of type '{ [x: number]: undefined; "edmx:Edmx": { "@xmlns:edmx": string; "@xmlns:m": string; "@Version": s...' is not assignable to parameter of type 'string'.

MERGE / PATCH via POST did not work anymore

As of Aug 30th, 2016 (#dc346c424fbef73cabc73576169ffdbabc05cb47) MERGE/PATCH via POST requests did not work anymore. Clients often use this workaround cause direct MERGE/PATCH request sometimes don't pass the firewall of enterprises.

This should work now again.

Metadata missing for single entity requests

for single entity requests like

http://0.0.0.0:3000/odata/People('2')

Metadata is not provided. Current result looks like this:

{
  "d": {
    "firstname": "Helmut",
    "lastname": "Tammen",
    "gender": null,
    "age": null,
    "id": 2
  }
}

Create an example for Unit tests

More unit tests should be implemented. Therefore some examples how to handle the promises that are spread around the source code should be created

Implement more OData filter options

OData filter is currently not completely implemented. Only basic filter options are supported.
See methods ODataGetBase._applyFilter and ODataGetBase._convertAstToLoopbackFilter for details.

ID Injection using ObjectId type

Hello @htammen,

We created an OData app based on your tutorials and we used the IdInjection set to true in the model json. It works just fine.

However, we are trying to consume this data on SAP Analytics Cloud and we are getting the error:
"Attribute should specify a namespace qualified name or an alias qualified name" when we try to create a model from the service.

The reason for this error is that the id type is 'ObjectId'. When we disable IdInjection and set the id the field to be a string, its type turns Edm.String and we do not get the error anymore. However, then we are not able fetch any entries from the entity as we get the error "TypeError: Cannot read property 'property' of undefined"

Do you know if it is possible to change the default type of the property when IdInjection is activated?

Thanks

Central method _getRequestModelClass threw error

The widely used method commons._getRequestModelClass threw error when loopback has not defined ModelClass.definition._ids. Don't know why this is not defined in some cases even though there is a id column but it happens.
Fixed this issue.

Code outdated?

Hi @htammen,

I wanted to try your n-odata-server, but I guess LoopBack evolved into a version not compatible with yours. First, the link "Look here for details on installing and creating a loopback application" in Prerequisites is dead. Second, installation of LoopBack via "npm install -g strongloop" throws lots of warnings about deprecated components, and also lots of errors.
So I installed via "npm install -g @loopback/cli", and successfully created the LoopBack 4 ToDo Application (app, model, datasource, repository and controller), which works fine.
But as I understand out of your description, there should be a directory server with the files component-config.json and middleware.json, which should be enhanced with some coding, after installing the n-odata-server. But this directory does not exist.

Could you please revise your project.

Thanks,
chilkm

Enhancement for filter options

Properties of associated objects are referred in OData with / but in
loopback with .
With this change it is possible to filter for referred properties

TS Compiling TypeError: "Cannot set property 'oDataGet' of undefined"

Hi!

I get an error after running the grunt-ts task and restarting the app:

C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\n-odata-server\lib\odata.js:23
this.oDataGet = new ODataGetV2.ODataGet();
^
TypeError: Cannot set property 'oDataGet' of undefined
at _handleODataVersion2 (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\n-odata-server\lib\odata.js:23:19)
at module.exports (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\n-odata-server\lib\odata.js:169:30)
at C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\loopback-boot\lib\executor.js:425:5
at Array.forEach (native)
at setupComponents (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\loopback-boot\lib\executor.js:418:27)
at execute (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\loopback-boot\lib\executor.js:35:3)
at bootLoopBackApp (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\node_modules\loopback-boot\index.js:140:3)
at Object. (C:\Users\jrueckert\workspace\Komplex-e\Komplex-e_head\js-loopback\server\server.js:21:1)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)

I didn't change either the grunt config nor any of the files. After that i played around with the grunt-ts config and reinstalled the typings aswell, but no success so far. Any guess what might be wrong?

Thanks in advance!

Regards
Johannes

Do not expose non-Public Models

Currently, n-data-server seems to expose also models which are set to non-public like this:

  "ACL": {
    "dataSource": "db",
    "public": false
  },

To be in-line with loopback, this should not be the case.

HasOne relationship doesn't work

Fixed. HasOne relationships leads to a timeout error when requesting data of this relationship.
Example:
Imagine a product that has exactly one productDetail object connected to it via a hasOne relationship

{
  "name": "Product",
  "plural": "Products",
  "base": "PersistedModel",
...
  "relations": {
    "ProductDetails": {
      "type": "hasOne",
      "model": "ProductDetail",
      "foreignKey": "productId"
    }
  },
}

The following request did not work

http://0.0.0.0:3000/odata/Products(4)/ProductDetails

The problem is fixed now. Since release 0.3.10 in which some restructuring has happened this was not implemented anymore. Reimplemented it

Error on get http://server:port/odata/$metadata

When I try access myserver:3000/odata/$metadata it's returning this error:
[INFO] console - TypeError: commons.getPluralForModel is not a function
at Metadata. (D:\Node\of-api\node_modules\n-odata-server\lib\base\metadata\metadata.js:55:34)
at Array.forEach (native)
at Metadata.buildMetadata (D:\Node\of-api\node_modules\n-odata-server\lib\base\metadata\metadata.js:18:28)
at ODataGet._getMetadataDocument (D:\Node\of-api\node_modules\n-odata-server\lib\v2\get\odata_get.js:68:38)
at ODataGet.handleGet (D:\Node\of-api\node_modules\n-odata-server\lib\v2\get\odata_get.js:31:38)
at _handleGet (D:\Node\of-api\node_modules\n-odata-server\lib\odata.js:140:19)
at D:\Node\of-api\node_modules\n-odata-server\lib\odata.js:35:32
at Layer.handle as handle_request
at trim_prefix (D:\Node\of-api\node_modules\express\lib\router\index.js:312:13)
at D:\Node\of-api\node_modules\express\lib\router\index.js:280:7

However when I access just /odata it's showing the correct document.

DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Dear Mr. Tammen,

first of all thank you for this module.
I am trying to setup the node.js based ODATA server and experiencing the problem described below:

  1. I have setup the loopback
  2. I have installed the n-odata-server (according to the help)
  3. I have configured the app according to the description
  4. I am able to call http://localhost:3000/odata/, and I am getting the proper respond
  5. I am able to call the http://localhost:3000/odata/MyEntitySet, and I am getting the proper respond
  6. But when I am calling http://localhost:3000/odata/$metdata, I am getting the error:

[2017-12-08 21:03:49.464] [ERROR] console - (node:2489) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: Missing attribute value for attribute Type of element Property

As the result I cannot properly work with the odata server. Target is in final end to use the server in conjunction with openui5/sapui5 app using ODATA.

I thank you in advance for the help
Best Regards / Mit freundlichen Grüßen
Igor Abelev
node verion = 9.0.0
n-odata version = 0.4.1

Loopback V3 With $metadata Issue

Hi , i try to get meta data from loopback v3

  1. i can access /odata/$metadata without User and AccessToken in model-config.json
    Loopback V3 odata Work

2)if i put User and AccessToken in model-config.json i get bellow error
LoopbackV3 With nodataserver

Please give guide to solve this issue
thanks & regards
umayaraj.b

Provide Possbility to set Logger

Currently n-odata-server comes with log4js (which is not a common choice) but unfortunately, it's not possible to provide an own logger and neither it seems to be possible to even configure the existing one (which seems to create the file n_odata_server.log). This makes it hardly usable for a production scenario.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.