Giter Club home page Giter Club logo

converter's Introduction

GitHub Workflow Status Coveralls

odata2ts

If you use TypeScript and need to interact with an OData service, then odata2ts might be for you. It centers around the generation of TypeScript artefacts out of readily available metadata descriptions of given OData services.

With the help of odata2ts you can:

  • generate tailor-made TypeScript model interfaces for entities, complex types and what not
  • generate powerful q-objects to leverage the type-safe and fluent query builder
  • generate a full-fledged, domain-savvy OData client supporting type-safe queries, CRUD operations and more

Feature Highlights:

  • support for OData V2 and V4
  • generation of compiled JS / DTS or (prettified) TypeScript files
  • allows for handling multiple odata services
  • TypeScript based configuration file
  • powerful, type-safe and fluent query builder
  • use existing or own converters to interact with data types of your choice
  • allows for name mappings of attributes

The generated code artefacts can be used in Browser or Node.js environments.

Documentation

Getting Started

Main documentation for the odata2ts eco system: https://odata2ts.github.io

Examples

See example packages for examples of how to integrate odata2ts.

Support, Feedback, Contributing

This project is open to feature requests, suggestions, bug reports, usage questions etc. via GitHub issues.

Contributions and feedback are encouraged and always welcome.

See the contribution guidelines for further information.

Spirit

This project has been created and is maintained in the following spirit:

  • adhere to the OData specification as much as possible
    • support any OData service implementation which conforms to the spec
    • allow to work around faulty implementations if possible
  • stability matters
    • exercise Test Driven Development
    • bomb the place with unit tests (code coverage > 95%)
    • ensure that assumptions & understanding are correct by creating integration tests

License

MIT - see License.

converter's People

Contributors

texttechne avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

converter's Issues

feature suggestion: better, explicit chaining

Background:

I mean to write a converter which fixes a faulty service implementation, and then hand over to the existing converters. In my case my converter would convert Edm.Datetime to Edm.Datetime. I would then hand over to v2-to-v4 converter and whatever follows the chain.

However, my understanding is that an Edm.Datetime to Edm.Datetime would overwrite any registered Edm.Datetime to Edm.DatetimeOffset converter (and maybe result in an endless loop?).

Now I could replace v2-to-v4 completely with my own, but I would rather just keep that as-is and inject my own converter in front.

Is there a way to specify the converter chain explicitly? Could I inject my converter at the start and then let the converter runtime work through any other chained converters after?

If not, that's the feature request :)

Converter for Big Numbers (`Edm.Int64` & `Edm.Decimal`)

The go-to libraries here seem to be the stuff developed by MikeMcl:

  • big.js: the minimal version
  • bignumber.js: full decimal and non-decimal arithmetic (recommended for advanced financial stuff)
  • decimal.js: full decimal and non-decimal arithmetic (recommended for scientific usage)

See the comparison.

  • One package @odata2ts/converter-big-numbers
  • contains 3 converters: big, bignumber, decimal
  • by default big is used
  • only peer deps

BigInt Converter

Converts Edm.Int64 to JS' new BigInt type.
Source type must be a string, not number.

We must be aware of the fact that V4 converts Edm.Int64 automatically to numbers (see odata2ts#106).

For V2, this converter would work out-of-the-box.

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.