Typing

Making the model visible to the compiler — generated types for entities and events so a rename breaks the build rather than production.

Overview

SAP SHIPS
Node.js →

@cap-js/cds-typer Generates TypeScript types from a CDS model.

@cap-js/cds-types Type definitions for the CAP Node.js SDK.

Java →

com.sap.cds:cds-maven-plugin The Maven plugin that runs CDS build steps in a CAP Java project: compiling the model, generating typed Java accessor interfaces and adding facets to an existing project.

Not covered: On Node.js it stops at what capire calls "a certain degree of type safety": the declarations in @cap-js/cds-types trail the latest @sap/cds release, with gaps and errors capire announces itself, and every property of a type generated by @cap-js/cds-typer is optional by default. Past that edge cds-internal-tool publishes its own "fresh cds runtime types" for authors of CAP extensions, and on Java any data read as a plain Map keeps its element names unchecked until runtime.

SourceCDS Typerchecked
THE COMMUNITY ADDS

Artifacts4

4 of 4 artifacts
ArtifactSignals
Build tools2
@cap-js/cds-typerGenerates TypeScript types from a CDS model
Signals
none
com.sap.cds:cds-maven-pluginMaven plugin running CDS build steps in a CAP Java project
Signals
none
Packages2
@cap-js/cds-typesType definitions for the CAP Node.js SDK
Signals
none
cds-internal-toolReusable internals for authors of CAP extensions
Signals
Functional boundary

Content3

Group by
Piece, what it offers
Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-ts Part - 2
SAP Community, satya-dev, BlogRunnable code
New majors
Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-ts
SAP Community, satya-dev, BlogA recipeRunnable code
New majors
TypeScript Sheriff: How can I use TypeScript in the SAP ecosystem? (Part 2 of 3)
SAP Community, MikeDoyle, part 2 of 3, BlogThe reasoning
Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-ts Part - 2
SAP Community, satya-dev, BlogRunnable code
New majors
Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-ts
SAP Community, satya-dev, BlogA recipeRunnable code
New majors

Seen working3

ArtifactSignals
Samples3
cap-cds-typerCAP service in TypeScript using types from @cap-js/cds-typer
none
cap-typescriptMinimal CAP project in TypeScript
No license
SAP-NPM-API-collectionAPI documentation extracted from SAP-published npm packages
none

Details

Coverage
statecore and community, CAP
assessed
relationshipunassessed
SourceCDS Typerchecked SourceUsing TypeScriptchecked SourceUsing TypeScriptchecked SourceWorking with CDS Datachecked Sourcecds-internal-tool 1.7.9, README in the npm registrychecked
For your agent