All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. The format is based on Keep a Changelog.
- Added missing properties for
log
incds.env
- Added overload for
service.read
to be called with aref
- Added types for anonymous, privileged, and default user
- removed dependency to
@types/express: ^4.17.21
in favour of a peerDependency to@types/express: >=4
- [breaking] Removed type
TypedRequest<T>
and replaced it with justRequest<T>
- Use
Required
instead ofDeepRequired
in projection function to avoid complexity errors from TypeScript - Added missing type inference for
.set
/.with
ofUPDATE
- Added missing type inference for
.entries
ofUPSERT
andINSERT
- Variants of
SELECT.one(T)
will now returnT | null
, instead ofT
- Added missing type for
Request.before('commit', …)
- Added missing types for
Request.on('succeeded' | 'failed' | 'done', …)
- Added missing type for
cds.test.log
- Added missing
.ref
in CQN queries - Added missing
.forUpdate
,.forShareLock
, and.search
incqn.SELECT
- Calling
SELECT.one('...').from(Plural)
now properly returns a single instance
- Added missing type for
cds.context.model
- Added missing type for
req.query.elements
- Made constructors for query parts (
SELECT
,UPDATE
,DELETE
, ...) private, as they should only be accessed statically SELECT
returns a single instance now when specifying a primary key
cds.app
typed as express.js applicationcds.cli
CLI argumentscds.requires
types for MTX servicescds.utils.colors
types- The CQL methods
.where
and.having
now suggest property names for certain overloads. Service.before/on/after(event, target...)
now accept also an array of typer-generated classes in thetarget
parameterlocalized
variants toSELECT
- Most
cds.requires
entries are now optionals. cds.connect.to
now also supports using a precompiled model.- Properties of entities are no longer optional in projections, eliminating the need to perform optional chaining on them when using nested projections
- The
@types/sap__cds
link created by thepostinstall
script now also works in monorepo setups where the target@cap-js/cds-types
might already be preinstalled (often hoisted some levels up).
- Removed array-like methods from model parts (
.map
,.find
, etc.). To still use them, apply spreading to object in question first.
Service.emit(...)
can now also be called with custom eventsService.before(...)
andService.after(...)
now accept bound and unbound functions as parameterconnect.to (ServiceClass)
as alternative to'service'
stringconnect.to ('db')
returningcds.DatabaseService
.before(...)
,.on(...)
, and.after(...)
now properly infer inflection when a typer-generated class is passed as second parameter
EACH
event has appropriately been renamedeach
to reflect runtime behaviour
- Installation no longer fails if symlink
@types/sap__cds
exists
- Symlink
@types/sap__cds
correctly created in case of upgrading@cap-js/cds-types
.
- Scripts
postinstall
andprerelease:ci-fix
now work correctly on windows.
postinstall
script now creates a relative symlink from@types/sap__cds
to allow the project to be moved/ renamed.
This is a prerelease version (next
) as a preview for the upcoming release of cds 8.
- Wrapped all types into an augmented module declaration for
@sap/cds
. - Added a postinstall script to symlink
@cap-js/cds-types
to@types/sap__cds
to benefit from the default type resolution mechanism employed by Definitely Typed.
This is a prerelease version (next
) as a preview for the upcoming release of cds 8.
- Linked definitions are now available via
cds.linked
, especiallycds.linked.LinkedCSN
andcds.linked.classes
with its relevant type definitions
This is a prerelease version (next
) as a preview for the upcoming release of cds 8.
- Corrected
exist(…)
toexists(…)
- Added signatures for
cds.outboxed
andcds.unboxed
- Added signature for
cds.middlewares.add
- More
cds.env
properties and types - Exposed types related to
cds.linked
through the facade. Types describing unlinked CSN should generally not be needed, but are still available throughcds.csn.…
- Improved signatures for
cds.env.folders
andcds.env.i18n
fromany
to a more descriptive type Service.prepend
is no longer async- All linked classes are now available via
cds.linked.classes
(and partially via the facade) - Getters in
service
instances now return the appropriate classes. E.g.service.entities
returns instances oflinked.entity
- [breaking] Linked definitions are no longer an intersection type of all possible linked classes, but more specific to their actual use (see above). This implies that users may have to narrow the type they are using explicitly, use another getter (see above), or use explicit casts.
- [breaking] Only the
.after('READ', ...)
differentiates between singular and plural entities. In all other cases the plural case is assumed.
SELECT.from
and related variants now work on the.drafts
property and behave likeSELECT.from(<Plural>)
cds.log
can now also be called with the names of log levels- Reintroduced missing
QueryAPI.tx
and add deprecation note forQueryAPI.transaction
- Type for special error listener
srv.on('error')
source
,column_expr
, andpredicate
have been converted to partial intersection types. This offers all possible optional properties. You will have to make sure to check their presence when accessing them
srv.send
overload to also allow optional headers- Reflected types like
cds.entity
,cds.struct
,cds.Association
are now properly exposed cds.builtin.types
got a more accurate type- The
LinkedEntity.drafts
property is now optional. At runtime, it's only set for drafted entities. cds.model
is marked as modifiable (for tests only!)SELECT.from
got itsref
property back
- Rework of the export structure of the main
cds
facade object, so that e.g.cds.Request
andcds.User
work again
- TSDoc comments have a proper structure
- Initial release, still with gaps though