Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@odata2ts/odata2ts

odata2ts37.5kMIT0.39.1TypeScript support: included

Flexible generator to produce various TypeScript artefacts (from simple model interfaces to complete odata clients) from OData metadata files

odata2ts, generator, cli, odata, ts, model, odata client, typescript, v2, v4

readme

README.md

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.39.1 (2024-12-18)

Bug Fixes

  • odata2ts: add Accept header for metadata downloads (#340) (dcdd997)

0.39.0 (2024-10-28)

Features

  • generator: add cast operations to base type services (#327) (df52284)
  • generator: conversion of subtype by control info (#331) (a8a8a50)
  • generator: qobjects with casted subtype props (#328) (88eb9bd)
  • service: subtype services (#332) (6918735)
  • service: support no url encoding (#326) (304bc62)

BREAKING CHANGES

  • service: dedicated options parameter for all services

0.38.1 (2024-09-19)

Bug Fixes

  • generator: api usage analysis must respect alias (#317) (5877161)

  • generator: set peer dependency of TS to >= 4.7 (949d874)

0.38.0 (2024-09-11)

Bug Fixes

  • auto name clash resolution for v4 actions (#315) (3366843)

  • generator: add rimraf as dependency (9f08ccd)

  • generator: use typeof when using enums as types (baf784f)

Features

  • compile src & test folders as sanity check (12607f0)

  • generator: allow for numeric enums (#308) (a5c36e6)

0.37.0 (2024-08-25)

Code Refactoring

  • vitest instead of jest & switch to ESM (#300) (7bc8888)

Features

  • use kebap-case for folder names (unbundledFileGeneration) (9f26e1f)

BREAKING CHANGES

  • as there is no generated index file all file paths must be fixed.

  • ESM tends to break stuff

0.36.3 (2024-08-12)

Bug Fixes

  • generator: v4 types like Edm.Date, Edm.TimeOfDay and Emd.Duration are not recognized (#295) (3b63969)

0.36.2 (2024-08-01)

Bug Fixes

  • generator: apply type-only imports for q-objects in bundled mode (#294) (a439d0a)

0.36.1 (2024-07-31)

Bug Fixes

  • generator: more type-only imports depending on usage (#292) (c0b06f9)

0.36.0 (2024-07-31)

Features

  • generator: add ts-nocheck to each generated file by default (#284) (655a3ab)

  • generator: generate services based on API reference chain (#275) (8fd415b)

  • generator: support function overloads for different parameter sets (#282) (0b53271)

  • generator: support type-only imports (#290) (dea381e)

  • model files always get type checked (no @ts-nocheck) (#288) (43ca58b)

BREAKING CHANGES

  • generator: generated code won't be type checked anymore. Use debug: true to get type checking back.

0.35.0 (2024-05-16)

Bug Fixes

Features

0.34.0 (2024-05-03)

Bug Fixes

  • odata2ts: don't generate main model & q-object file in unbundled mode if empty (#268) (e5e69a5)

Features

0.33.2 (2024-04-22)

Bug Fixes

  • generator: add special logic for bound operation name clas resolution (gets prefixed by bound entity) (#259) (2a0f9ff)

  • generator: await ensureDir calls (99c679d)

  • generator: in unbundled mode unbound action models should go into main files (#264) (5dd52ec)

  • generator: too many imports for services with entity nav props (1cae569)

  • generator: write main service file only once (74e39a0)

  • generator: wrong namespace prefix calculated (2ad5a56)

0.33.1 (2024-03-23)

Note: Version bump only for package @odata2ts/odata2ts

0.33.0 (2024-03-17)

Bug Fixes

  • generator: enumerate generated files for emit mode ts (#249) (e58e3d5)

Features

  • generator: auto detected service names are run through pascalCase to ensure valid class names (#250) (04fcf49)

  • generator: no collection services for entity types without keys (#248) (56540b2)

  • generator: support abstract entities (#247) (cbf5121)

0.32.0 (2024-03-10)

Bug Fixes

  • fully qualified name for EntitySet, Singleton & FunctionImport by EntityContainer name instead of namespace (#245) (6047122)

Code Refactoring

Features

  • report name clashes & introduce auto name clash resolution (#239) (28b38dc)

BREAKING CHANGES

  • Config options entitiesByName and operationsByName have been dropped. You must use byTypeAndName instead and provide the new type property for each configuration.

Renaming now supports EntityType, ComplexType, EnumType and any operation type (FunctionImport, Function, Action).

0.31.1 (2023-11-15)

Bug Fixes

  • generator: collection operations are not generated (#235) (5157ded)

0.31.0 (2023-10-29)

Bug Fixes

Features

  • generator: allow for renaming of operations (#231) (8bff901)

  • generator: entity config supporting namespaces (#226) (ff52dc0)

BREAKING CHANGES

  • generator: regular expressions must now match against the fully qualified name (e.g. "Trippin.Person") instead of the simple name (e.g. "Person").

When matching exactly by name, you can use the simple name as before or the fully qualified name (alias is also supported).

0.30.0 (2023-10-05)

Features

0.29.1 (2023-09-13)

Note: Version bump only for package @odata2ts/odata2ts

0.29.0 (2023-08-08)

Bug Fixes

  • odata2ts: downgrade prettier plugin xml to 2.2.0 (36525f9)

Features

  • service generation for primitive types (#201) (ea9e645)

BREAKING CHANGES

  • removed the public method "getQObject"

  • refactor(odata2ts): use __base properties of inherited services

  • feat(service): introduce PrimitiveTypeService

  • feat(odata2ts): allow to generate PrimitiveTypeServices via option enablePrimitivePropertyServices

  • feat(example): integration tests for primitive type services

0.28.0 (2023-07-31)

Features

0.27.0 (2023-07-20)

Features

0.26.1 (2023-07-13)

Bug Fixes

  • odata2ts: correct fieldName for nav props (#189) (ec198d4)

0.26.0 (2023-07-13)

Bug Fixes

  • odata2ts: bound operations with namespace as part of the name (#187) (68209f2)

Features

  • odata2ts: allow property configuration via entity (#188) (bdb5bef)

0.25.1 (2023-07-10)

Bug Fixes

0.25.0 (2023-07-10)

Bug Fixes

  • odata2ts: use qualified name for bound operations (#182) (120c9b8)

Features

  • odata2ts: support for multiple namespaces by merging (#175) (db8fd61)

  • odata2ts: support schema alias (#181) (e0c04a8)

  • odata2ts: support TypeDefinition elements (#183) (d77d2cb)

0.24.0 (2023-06-14)

Features

  • odata2ts: generate comments for model properties (#173) (b218297)

0.23.1 (2023-06-10)

Note: Version bump only for package @odata2ts/odata2ts

0.23.0 (2023-06-03)

Features

  • force new minor for new http-client-api (5628666)

0.22.0 (2023-04-27)

Code Refactoring

  • odata2ts: dispense with resolver & directly implement related services as getter (9b49501)

BREAKING CHANGES

  • odata2ts: Changed defaults for properties representing related services: no prefix anymore, just the name of the property as function (previously, prefix navTo).

Removed get method of EntitySetServices: use property directly instead.

Removed the following naming options regarding generated services: serviceResolverFunction, publicProps

0.21.0 (2023-04-20)

Features

  • option for extra-results-wrapping for V2 services and model generation only (#155) (795a04c)

0.20.3 (2023-04-18)

Bug Fixes

  • odata2ts: add empty array as type for empty params (#154) (fbdd000)

  • prevent idModel and qIdFunction from baseclass to be overwritten in digester which breaks multiple inheritance (#150) (e17038e)

  • Reorder models and qobjects by inheritance (base types first) (#151) (7d456fe)

0.20.2 (2023-04-13)

Note: Version bump only for package @odata2ts/odata2ts

0.20.1 (2023-04-08)

Note: Version bump only for package @odata2ts/odata2ts

0.20.0 (2023-04-04)

Features

  • odata2ts: Entity configuration options (#145) (03264c5)

0.19.2 (2023-03-23)

Bug Fixes

  • odata2ts: entity resolver uses wrong Q-Id function when id is inherited (e05f4eb)

  • odata2ts: semantically wrong unit test (541a687)

0.19.1 (2023-02-24)

Bug Fixes

  • odata2ts: ts-node as proper dep instead of peer-dep (2050524)

0.19.0 (2023-02-14)

Features

  • improved handling of multiple schemas (#133) (9c7733f)

0.18.6 (2023-02-13)

Bug Fixes

0.18.5 (2023-02-13)

Bug Fixes

0.18.4 (2023-02-13)

Note: Version bump only for package @odata2ts/odata2ts

0.18.3 (2023-02-03)

Bug Fixes

  • odata2ts: peer dep versions did not get auto upated (#120) (586627e)

0.18.2 (2023-01-11)

Bug Fixes

  • odata2ts: wrong generation of complex and enum params for q operations (#111) (f69aadf)

0.18.1 (2023-01-10)

Bug Fixes

  • odata2ts: no model param and no q operation generation for collection bound operations (#110) (71769c2)

0.18.0 (2023-01-07)

Bug Fixes

  • odata2ts: configurable naming of main service (c2bdeeb)

Code Refactoring

  • odata2model => odata2ts (#97) (4085c7c)

  • rename odata-uri-builder to odata-query-builder (#98) (e0de825)

Features

  • odata-service: introduce entity service resolver (#100) (66dd853)

  • odata2ts: add snakeCase as new renaming strategy (#101) (09f9bfb)

  • odata2ts: minimal naming options (#104) (67ddfa7)

  • odata2ts: use navToX instead of getXSrv (#99) (4aafcb0)

BREAKING CHANGES

  • odata2ts: option service.fileNames was removed in favour of service.main, so that the main service can be configured individually; the underlying bug was that file names SHOULD NOT be configurable for services

  • odata2ts: changed default: uses "navToX" instead of "getXSrv" to navigate to other services; old behaviour can be restored via naming configuration prefix: "get", suffix: "Srv"

  • rename module odata-uri-builder to odata-query-builder; API completely refactored by renaming all models, classes, functions, props from "uri" to "query"

  • rename odata2model to odata2ts; affects import in odata2ts.config, affects scripts in package.json or any scripts which use to call odata2model command directly

0.17.0 (2023-01-05)

Bug Fixes

  • odata2ts: broken js generation (#95) (6df7392)

  • odata2ts: operation return type for primitive values is wrong (#91) (fcbc28a)

Code Refactoring

  • odata2ts: changing default regarding renaming (#94) (67124a2)

Features

  • dedicated number params for V2 (#84) (7a440d9)

  • encode & decode function params properly (#96) (ca88f57)

  • improved number handling (#86) (08e9fe0)

  • odata2ts: automatically handle managed props (#88) (37eef19)

BREAKING CHANGES

  • odata2ts: new default: allowRenaming=false; removed prop naming.disableNamingStrategy

0.16.1 (2022-12-21)

Bug Fixes

  • odata2ts: import deferred content from core (V2 only) (66bee43)

  • only import QEntityPath when needed (81a4e77)

0.16.0 (2022-12-18)

Bug Fixes

  • odata2model: don't generate useless constructors (f495604)

  • odata2ts: disable entities by name from config interfaces => not implemented yet (96fefbe)

  • odata2ts: disable own section about entitiesByName (78d9c6e)

Features

  • odata2model: extensive configuration model via config file (#67) (a42aee4)

  • odata2ts: adapt method generation for services (486a85c)

  • odata2ts: adapt query object generation to OperationReturnTypes (734e2bd)

  • odata2ts: apply name mapping in all places (dd5a6fd)

  • odata2ts: property configuration with name mapping and managed flag (#78) (797566c)

0.15.0 (2022-12-18)

Bug Fixes

  • odata2model: don't generate useless constructors (f495604)

  • odata2ts: disable entities by name from config interfaces => not implemented yet (96fefbe)

  • odata2ts: disable own section about entitiesByName (78d9c6e)

Features

  • odata2model: extensive configuration model via config file (#67) (a42aee4)

  • odata2ts: adapt method generation for services (486a85c)

  • odata2ts: adapt query object generation to OperationReturnTypes (734e2bd)

  • odata2ts: apply name mapping in all places (dd5a6fd)

  • odata2ts: property configuration with name mapping and managed flag (#78) (797566c)

0.14.2 (2022-09-09)

Bug Fixes

  • IdFunction never gets v2Mode flag (f36d173)

0.14.1 (2022-09-08)

Bug Fixes

  • corrected int tests (fff88be)

  • don't map param names for now (f39f541)

0.14.0 (2022-09-08)

Code Refactoring

  • centralize formatting and parsing of params & attributes (#62) (ba93a27)

Features

  • odata-service: allow to pass custom headers per request (#58) (d783e51)

  • odata2model: add typescript support for odata2ts.config (70a01e5)

  • odata2model: support V2 functions with HTTP method POST (#61) (c9213fa)

BREAKING CHANGES

  • UrlHelper including compile and parse methods have been removed; interfaces for EntityKeyProp, EntityKeySpec, InlineUrlProp, and InlineUrlProps have been removed; parsing of passed parameters is more strict.

Introducing static functions on QPath objects to format and parse url conform values.

Introducing QParams, QFunction and QAction to bundle logic around operations including the id function (url path generation).

Generate models for IdType of entity & parameter models for functions / actions in general

Generate Q-objects for EntityIdFunctions, and functions & actions in general

0.13.1 (2022-08-25)

Bug Fixes

  • always create errors with new operator (#54) (562dede)

0.13.0 (2022-08-11)

Code Refactoring

  • uri-builder: composition over inheritance, proper interfaces (#48) (36c8a0a)

Features

  • uri-builder: V2 implementation of "expanding" method (#49) (e237c61)

BREAKING CHANGES

  • uri-builder: It was possible to select nested props by using q-props (V2 only); this syntax has been removed and will be replaced by making use of the current V4 syntax: you first expand the property (method "expanding") and then select (or expand) on the expanded entity.

  • uri-builder: ODataUriBuilder was removed from export, it might have served as base class but was of no other use.

0.12.1 (2022-08-01)

Bug Fixes

  • add imports for returnType & don't camel case function / action params (#44) (b46e4fd)

0.12.0 (2022-08-01)

Bug Fixes

  • remove superfluous constructor from qObjects (#41) (f5f5623)

Code Refactoring

  • consistent casing for services, models and props (#42) (70e6e92)

  • use proper getMethods for services (#43) (e05c818)

Features

  • createKey and parseKey for EntitySetService & correct V2 type prefixing (#39) (edd05bb)

  • typing improvements & editable model versions (#27) (df290df)

BREAKING CHANGES

  • use proper getMethods for services "getXxxSrv()" instead of get accessors "xxx"

  • consistent camel or pascal casing for services, models and props

  • fix: always empty output dir before generating

  • model has become a true query response model.

Properties which are nullable now allow null values instead of undefined;

complex types are never undefined, but can be nullable;

collections are never nullable.

V2 only: added deferred content typings for entity and entity collection properties.

  • feat: generate EditableModels and use in service for create, update, and patch

  • different signatures for all actions

  • test: proper test for ModelImportContainer & dataModel.getEditableModelName

  • test: proper test for DataModel

  • refactor(odata2model): don't always combine handling of complex and entity types

0.11.2 (2022-07-20)

Bug Fixes

  • guids in v2 have special syntax (guid'xxxx-...') (#35) (a551bcc)

0.11.1 (2022-07-11)

Note: Version bump only for package @odata2ts/odata2model

0.11.0 (2022-07-06)

Features

  • odata2model: actions & function on collection level (#33) (985b2dc)

0.10.1 (2022-06-30)

Bug Fixes

  • add prebulish script to guarantee building before publishing (b6986db)

0.10.0 (2022-06-30)

Features

  • use pascalCase for file names and allow to override serviceName (#30) (5aa1e44)

BREAKING CHANGES

  • new file names

0.9.0 (2022-05-21)

Bug Fixes

  • V2 function params as query params (07a1f29)

  • odata2model: fix tests (efd12bc)

  • odata2model:DataModel: Duplicate keys when extending multiple times (157aa13)

  • odata2model:test: name northwind-v4 fixture correctly (39e77f4)

  • test: collect code coverage from src folders, thus exhibiting untested code (3acef8b)

  • test: fix data-model tests (b8abb8a)

  • test: make coverage test run again (f2d360b)

  • on windows ts-node needs cwd-mode flag (4f3c0f5)

Features

  • integration tests for V2 (ODataV2 sample service) (98bf0b8)

  • odata2model: FixtureComparator ignores @ts-ignore (b483ed5)

  • odata2model: move v4 tests & adapt expectations of fixtures (2f84127)

  • odata2model: V2 service generation support (2b17a01)

  • odata2model:Cli: load config from file via cosmiconfig (a490778)

  • odata2model:Cli: log file paths relative to working dir of process (fc1ce86)

  • test: add run-cli integration test (45a2da1)

  • test: app test (ad9d3f2)

  • test: Builder for generating Edmx schemas in JSON (227279a)

  • test: FixtureComparator (38b03bf)

  • test: ProjectManager test without testing formatting including some refactorings (8f666f3)

  • test: same tests for model & qobject generation (a4d882d)

  • test: ServiceGenerator tests & fixes (6a2c242)

  • test: test for ProjectManager (first draft) (f705b0b)

  • test: testing Model generation (6d7c530)

  • test: Tests for DataModel and EDMX digestion (5740292)

  • Feat/refactor query objects (#20) (67b662a), closes #20

BREAKING CHANGES

  • no EntityFactory anymore, no nominalized types in interfaces anymore, etc.

  • refactor(qObjects): getEntity with prefix option; by default without prefix

  • fix(qObjects): better QPath modelling

  • refactor(uri-builder): only use QueryObjects for typing & remove QEntityModel stuff

  • refactor(odata2model): generate new QObject classes

  • refactor(service): services now require Model as well as QClass

  • refactor(odata2model): generate services with new QObject classes

  • fix(odata2model): fix integration tests

  • fix: make int-tests for coverage task work again

  • fix: skip run-cli tests (don't work on github)

0.8.2 (2021-10-12)

Note: Version bump only for package @odata2ts/odata2model

0.8.1 (2021-09-17)

Bug Fixes

  • odata-service: revert exposure of Unnominalized (6ce4ea7)

0.8.0 (2021-09-17)

Bug Fixes

Code Refactoring

  • odata-service: use odata names as param names (73b130a)

Features

  • odata2model: unnominalize response values of actions / functions (4f284fa)

BREAKING CHANGES

  • odata-service: param names of complex keys have changed

0.7.1 (2021-09-16)

Note: Version bump only for package @odata2ts/odata2model

0.7.0 (2021-08-31)

Bug Fixes

  • odata2model: correct typing for returned collection types (3943f08)

  • odata2model: fix tests (96556cd)

  • service: don't use nominal types for input; use string instead (788dc5c)

Features

0.6.0 (2021-08-17)

Features

  • odata2model: add emitMode to allow js and/or d.ts generation (88e69ca)

0.5.0 (2021-08-16)

Bug Fixes

  • odata2model: add import for parameter types (03f25f4)

Features

  • odata2model: add bound func/actions & add primitive collections (c18daac)

  • odata2model: check for missing type & throw error (39cdd55)

0.4.0 (2021-08-16)

Bug Fixes

  • more service tests, fix prop names vs odata names (489b690)

  • odata2model: fix path for main entity sets (c8fba2a)

  • odata2model: wrong imort for service from root (1de6eef)

Features

  • odata2model: add CollectionService, rework main service file (026e999)

  • odata2model: add jest & add dev and peer deps (4076d1f)

  • odata2model: add keySpec to EntitySets & implement get() (500e576)

  • odata2model: dataModel with fileNames, qNames, models with baseProps & baseKeys & qObjects(collections only) (42d1630)

  • odata2model: generate ModelServices & EntitySetService (347bbbb)

  • odata2model: introduce ImportContainer to organize imports (6fab097)

  • odata2model: parse functions & actions & entityContainer stuff into DataModel (7fb9bb8)

  • odata2model: realize new QEntityCollectionPath prop (5eaf31a)

  • odata2model: service gen for unbound funcs with params (d7516da)

  • odata2model: service generation for unbound parameterless functions (2441aad)

  • odata2model: setup ServiceGenerator (8fbfffc)

  • odata2model: use dataModel.fileNames for app (9487893)

  • service: add singletons (5695389)

  • service: init navProps via accessor instead of getter methods (bb93f30)

0.3.0 (2021-08-10)

Bug Fixes

  • odata2model: give first schema priority (8fed26f)

Code Refactoring

  • QEntityModel without key spec (913cd11)

Features

  • odata2model: add type knowledge for function, action, complex & singleton (56f7e5f)

  • odata2model: generate Enums & CollectionPaths & respect baseClasses for QObjects (e9dfce5)

  • odata2model: model gen with support for complex types, enum types (f2d5b3b)

  • odata2model: support BaseType for entity & complex types (20c5ab2)

  • odata2model: support complex types & primitive collections (6481920)

  • add sample requests covering trippin features (2cc900f)

BREAKING CHANGES

  • odata2model: qObjects are generated differently

  • [query-objects]: QEntityModel without key spec & __collectionPath; [UrlBuilder]: path must be provided explicitly now for any entity set

0.2.1 (2021-07-23)

Bug Fixes

  • odata2model: respect suffix & prefix in relationships (cc59d9f)

0.2.0 (2021-07-23)

Features

  • odata2model: add options for suffix & prefix (d5d9a81)

0.1.4 (2021-07-08)

Note: Version bump only for package @odata2ts/odata2model

0.1.3 (2021-07-01)

Note: Version bump only for package @odata2ts/odata2model

0.1.2 (2021-07-01)

Note: Version bump only for package @odata2ts/odata2model

0.1.1 (2021-07-01)

Note: Version bump only for package @odata2ts/odata2model