Releases: cap-js/cds-typer
Releases · cap-js/cds-typer
v0.28.1
v0.28.0
Added
- Schema definition for
cds.typer
options inpackage.json
and.cdsrc-*.json
files - Added a static
elements
property to all entities, which allows access to theLinkedDefinitions
instance of an entity's elements - Schema definition for
typescript
cds build task. .drafts
property of any entityE
is now of typeDraftOf<E>
, orDraftsOf<E>
for plurals, respectively. This type exposes dditional properties that are available on drafts during runtime.
Fixed
- Entity elements of named structured types are flattened when using the option
--inlineDeclarations flat
override
modifier on.kind
property is now only generated if the property is actually inherited, satisfying stricttsconfig.json
s- Properly support mandatory (
not null
) action parameters witharray of
types - Static property
.drafts
is only create for entity classes that are actually draft enabled
v0.27.0
Changed
- Any configuration variable (via CLI or
cds.env
) can now be passed in snake_case in addition to camelCase - Action parameters are now generated as optional by default, which is how the runtime treats them. Mandatory parameters have to be marked as
not null
in CDS/CDL, ornotNull
in CSN.
Fixed
- Fix build task for projects with spaces
- Fixa bug where cds-typer would produce redundant type declarations when the model contains an associations to another entity's property
v0.26.0
Added
- Added a CLI option
--useEntitiesProxy
. When set totrue
, all entities are wrapped intoProxy
objects during runtime, allowing top level imports of entity types. - Added a static
.kind
property for entities and types, which contains'entity'
or'type'
respectively - Apps need to provide
@sap/cds
version8.2
or higher. - Apps need to provide
@cap-js/cds-types
version0.6.4
or higher. - Typed methods are now generated for calls of unbound actions. Named and positional call styles are supported, e.g.
service.action({one, two})
andservice.action(one, two)
. - Action parameters can be optional in the named call style (
service.action({one:1, ...})
). - Actions for ABAP RFC modules cannot be called with positional parameters, but only with named ones. They have 'parameter categories' (import/export/changing/tables) that cannot be called in a flat order.
- Services now have their own export (named like the service itself). The current default export is not usable in some scenarios from CommonJS modules.
- Enums and operation parameters can have doc comments
v0.25.0
Added
- Declaring a type alias on an enum in cds now also exports it on value level in the resulting type
Fixed
- Classes representing views and projections will no longer carry ancestry to avoid clashes thereof with aliases fields
Changed
- All properties are now preceeded with the
declare
modifier to pass strict tsconfigs usinguseDefineForClassFields
ornoImplicitOverride
- The static
actions
property of generated classes now includes the types from all inherited classes to also suggest actions defined in a base entity/aspect/type.
v0.24.0
Fixed
- Suppressed an error that would incorrectly point out naming clashes when an entity was named in singular inflection in the model
- CDS aspects now also generate a aspect-function in singular inflection, similar to how entities do
Changed
- Aspects generate named classes again so that tooltips will show more meaningful provenance for properties
- The TypeScript task for
cds build
no longer looks for tsconfig.json to determine if the project has TS nature and instead checks the dependencies in the project's package.json for an occurrence oftypescript
v0.23.0
Fixed
- Plurals no longer have
is_singular
attached in the resulting .js files - Properties are properly propagated beyond just one level of inheritance
v0.22.0
Fixed
- Fixed a bug where keys would sometimes inconsistently become nullable
v0.21.2
Fixed
- The typescript build task will no longer attempt to run unless at least cds 8 is installed
v0.21.1
Fixed
- Added missing cds-plugin.js to exported files to properly enable calling
cds build --for typescript