Build toolBuild tooltypeRuns at build time. Nothing of it ships in the deployed application.See every one →What this type is →by SAPby SAPoriginPublished by SAP itself. A visible facet, never an input to a reading — a dormant official plugin reads exactly like a dormant independent one.See every one →

@cap-js/cds-typer

Generates TypeScript types from a CDS model.

Facts

Latestv0.41.1ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
TypingCAPTypingcapabilityMaking the model visible to the compiler — generated types for entities and events so a rename breaks the build rather than production.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds≥ 8@sap/cdsartifactThe peer range, as published.

Who is behind it

SAP Cloud Application Programming ModelSAP Cloud Application Programming ModelOrganisationMaintains this
In the atlas: maintains 34
@cap-js
maintainerJohannes VogtPersonContributes to this
In the atlas: maintains 1, contributes to 28, wrote 10
@Akatuoro
Olena VyshnevskaPersonContributes to this
In the atlas: contributes to 2
@alyonavyshnevska
Christian GeorgiPersonContributes to this
In the atlas: maintains 1, contributes to 53
@chgeo
Daniel HutzelPersonContributes to this
In the atlas: contributes to 32, wrote 3
@danjoa
Daniel O'GradyPersonContributes to this
In the atlas: contributes to 10
@daogrady
Guilherme DellagustinPersonContributes to this
In the atlas: contributes to 27
@dellagustin-sap
Olegs BugrovsPersonContributes to this
In the atlas: contributes to 1
@GoldSucc
Heiko WitteborgPersonContributes to this
In the atlas: contributes to 18
@hm23
Jörg MannPersonContributes to this
In the atlas: contributes to 4
@joergmann
Johannes VogelPersonContributes to this
In the atlas: contributes to 25
@johannes-vogel
18 contributors

What it declares

Every artifact

Type
Build tool
Origin
By SAP
Runtime
Node.js

As a build tool

Declared for
>=8
Distributed through
does not say

Connections2

Install

npm add @cap-js/cds-typer

Derived from the package name. No recipe recorded; the README has the configuration.

Learn more2

Readings
  1. Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-ts Part - 2satya-dev, SAP Community
  2. Exploring the TypeScript Ecosystem with @cap-js/cds-typer, cds-ts, and node-tssatya-dev, SAP Community
What changed
  1. v0.40.0

    output_d_ts_files defaults to true: the generated types are ambient .d.ts declaration files instead of .ts files. Setting it to false restores the old output.

    Makes stale:

    Build setups written around cds-typer emitting .ts files that TypeScript then compiles.

3 earlier
  1. v0.34.0

    use_entities_proxy, which allows static imports of the generated entity classes, defaults to true; setting it to false restores the earlier behaviour.

    Makes stale:

    Advice to switch on use_entities_proxy before importing generated entities statically.

  2. v0.33.0

    cds.Binary is typed as Buffer and cds.LargeBinary as Readable, matching @cap-js/hana and @cap-js/sqlite; legacy_binary_types: true restores the old types.

    Makes stale:

    Handler code typed against the earlier generated types for cds.Binary and cds.LargeBinary.

  3. v0.11.0

    compileFromCSN is no longer exported from the package's programmatic API.

README

quoted from cap-js/cds-typer under Apache-2.0, read
cap-js/cds-typer/README.mdOn GitHub

CDS type generator for JavaScript

REUSE status Unit Tests passing

About this project

Generates .ts files for a CDS model to receive code completion in VS Code.

Exhaustive documentation can be found on CAPire.

Known Restrictions

Certain language features of CDS can not be represented in TypeScript. Trying to generate types for models using these features will therefore result in incorrect or broken TypeScript code.

Changing Types

While the following is valid CDS, there is no TypeScript equivalent that would allow the type of an inherited property to change (TS2416).

entity A {
  foo: Integer
};

entity B: A {
  foo: String
}

Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.

Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright 2022-2022 SAP SE or an SAP affiliate company and cds-typer contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.

Apache-2.0, read

History

Latest

v0.41.1

Removed, Deprecated, Security, Features, Changed, Fixes 1

Notes
Added
Changed
Deprecated
Removed
Fixed
  • inline enum JS assignments (e.g. Entity.prop ??= {...}) are no longer emitted using the aspect's singular name as the left-hand side. Aspects have no runtime JS value, so such assignments caused a ReferenceError at startup. The assignments are now correctly emitted on the concrete entity that includes the aspect.
Security
  1. v0.41.0

    Removed, Deprecated, Security, Features, Changed, Fixes 2

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • properly handle .texts properties in combination with compat_texts_entities=false (default in cds10) during runtime.
    • emit correct import and namespace-qualified type reference for inline enum companion types when the parent type is defined in a different namespace.
    Security
  2. v0.40.2

    Removed, Deprecated, Security, Features, Changed, Fixes 2

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • emit kind property on events as static member to be properly consumed by cds-types.
    • do not cut off leading namespaces from top-level events, but only leading service names from events nested therein.
    Security
  3. v0.40.1

    Removed, Deprecated, Security, Features, Changed, Fixes 3

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • Events with dotted names (e.g. service S { event X.Y : {...} }) now generate a properly namespaced class namespace X { class Y } instead of producing duplicate top-level identifiers.
    • Event names now use the service-relative name (e.g. 'X.Y' without preceeding S), matching the name the CDS runtime uses when registering and emitting such events.
    • Entity elements of named struct types used within CDS aspects are now correctly flattened when using --inlineDeclarations flat.
    Security
  4. v0.40.0dated in the atlas

    Removed, Deprecated, Security, Features, Changed 1, Fixes 2

    Notes
    Added
    Changed
    • output_d_ts_files now defaults to true and emits proper ambient .d.ts declaration files instead of merely renaming .ts output files. Plain .ts files are treated as source by TypeScript and other build tools, which caused them to be compiled and their .js output to silently overwrite the runtime module exports generated by cds-typer. Projects with strict tsconfig.json settings will benefit from this change, as .d.ts files do not require special handling in cds build or development scripts. Set to false to restore the old behaviour.
    Deprecated
    Removed
    Fixed
    • Entities with name conflicts with any of their ancestors now have their aspect name generated properly again
    • Fixed sporadic [Object object] appearing in log output
    Security
  5. v0.39.1

    Removed, Deprecated, Security, Features, Changed, Fixes 1

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • Properly import entities from other services that are used in arrays/ compositions of many/ associations to many
    Security
  6. v0.39.0

    Removed, Deprecated, Security, Features 2, Changed, Fixes 1

    Notes
    Added
    • Added flag cds.env.typer.branded_primitive_types for branding CDS type definitions aliasing primitive TS types
    • Added support for non-ASCII identifiers in .cds files. Non-ASCII characters in identifiers are sanitised to valid TypeScript names. Identifiers consisting entirely of non-ASCII characters (e.g., Kanji) are replaced with random hashes. All affected identifiers are exported under their sanitised/hashed name and also as an alias preserving the original name. To use the original name, import it with import ... as '...' syntax.
    Changed
    Deprecated
    Removed
    Fixed
    • Association keys pointing to entities with inline enum types are now correctly typed in service projections across namespace boundaries
    Security
  7. v0.38.0

    Removed, Deprecated, Security, Features 1, Changed 2, Fixes

    Notes
    Added
    • Added (experimental) flag cds.env.typer.output_d_ts_files for generating output *.d.ts files instead of *.ts ones
    Changed
    • unbound actions will now assume the self type of never, instead of the former null
    • events will now have a static field kind: 'event', akin to the one in entities
    Deprecated
    Removed
    Fixed
    Security
  8. v0.37.0

    Removed, Deprecated, Security, Features, Changed, Fixes 3

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • Added declare statement on type definitions
    • Explicitly add an any[] type in generated boilerplate to avoid issues with noImplicitAny
    • Entities included via cds import now have their properties properly generated
    Security
  9. v0.36.0

    Removed, Deprecated, Security, Features, Changed, Fixes 2

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • targeting aspects in compositions now properly resolves them.
    • transitive references to property types of other entities now also work for enums.
    Security
  10. v0.35.0

    Removed, Deprecated, Security, Features, Changed 2, Fixes 1

    Notes
    Added
    Changed
    • action parameters annotated with @mandatory are no longer nullable
    • base definitions now properly import the default export of @sap/cds
    Deprecated
    Removed
    Fixed
    • Using cds.Map as type will no longer result in the property not being printed at all.
    Security
  11. v0.34.0dated in the atlas

    Removed, Deprecated, Security, Features 1, Changed 2, Fixes

    Notes
    Added
    • Improved performance of repeated cds-typer runs by introducing an option to cache CDS model between runs. By default, typer will only regenerate the files if the model has changed between runs, using blake2s256 as algorithm. The used version of cds-typer is included in the hash and will therefore be version-specific.
    Changed
    • [breaking] The config use_entities_proxy (allowing for static imports) is now set to true as default. You can set it to false to revert to the old behaviour.
    • Running cds watch will trigger cds-typer "*" before the initial startup
    Deprecated
    Removed
    Fixed
    Security
  12. v0.33.1

    Removed, Deprecated, Security, Features, Changed, Fixes 1

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • Enums are now exported in ESM style in ESM projects
    Security
  13. v0.33.0dated in the atlas

    Removed, Deprecated, Security, Features 2, Changed 2, Fixes

    Notes
    Added
    • Support new cds.Map type, which is emitted as {[key:string]: unknown}. The most appropriate type would in fact be {[key:string]: any}, which would also allow any and all keys. But would also cause issues with strict project configurations. Therefore, to effectively use cds.Map, users will have to cast the unknowns to the effective type they expect.
    • Introduce cds.env.typer.build_task to allow disabling the typescript build task shipped with cds-typer by setting it to false
    Changed
    • [breaking] The types cds.Binary and cds.LargeBinary are now generated as Buffer and Readable respectively to reflect the behaviour of the new database packages @cap-js/hana and @cap-js/sqlite. You can switch back to the old behaviour by adding legacy_binary_types: true to your project configuration.
    • CHANGELOG.md and LICENSE files are no longer part of the npm package.
    Deprecated
    Removed
    Fixed
    Security
  14. v0.32.1

    Removed, Deprecated, Security, Features, Changed, Fixes 2

    Notes
    Added
    Changed
    Deprecated
    Removed
    Fixed
    • default value for inline_declarations in help command
    • entity scope and namespace are now added in the correct order to inflected type names
    Security
  15. v0.32.0

    Removed, Deprecated, Security, Features 2, Changed 3, Fixes 1

    Notes
    Added
    • dedicated classes for inline compositions
    • dedicated text-classes for entities with localized elements
    Changed
    • prefixed builtin types like Promise and Record with globalThis., to allow using names of builtin types for entities without collisions
    • default export class representing the service itself is now exported without name
    • bumped peer-dependency to @cap-js/cds-types to >=0.9
    Deprecated
    Removed
    Fixed
    • referencing another entity's property of type cds.String in an enum will now properly quote the generated values
    Security
  16. v0.31.0

    Features 1, Fixes 3

    Notes
    Fixed
    • type-referencing a property that is a key no longer breaks the referring property
    • when targeting ESM, all imports within the generated types now add a /index.js-suffix to conform to modern module resolution mechanisms
    • leaving target_module_type at 'auto' now properly acts on a detected "type":"module"
    Added
    • cds aspects now generate a synthetic plural type too, to be used in composition of many
  17. v0.30.0

    Changed 1, Fixes 1

    Notes
    Changed
    • [breaking] when running cds-typer in a CAP project, the default for the outputDirectory option will be ./@cds-models instead of ./. This default takes the lowest precedence after setting it in the project's cds.env, or explicitly as CLI argument.
    Fixed
    • cds-typer no longer ignores the selected outputDirectory, which would also cause an issue during build
  18. v0.29.0

    Features 1, Fixes 1

    Notes
    Added
    • [breaking] cds-typer now tries to automatically detect whether it has to generate ESM or CommonJS in the emitted index.js files. This behaviour can be overridden via the --targetModuleType option. If you rely on these generated index.js files to be CJS despite your project being of ESM type, you need to manually tell cds-typer to generate CJS files!
    Fixed
    • The static .keys property now properly reels in key types from inherited classes.
  19. v0.28.1

    Fixes 2

    Notes
    Fixed
    • cds build no longer fails on Windows with an EINVAL error.
    • cds build also supports custom model paths in tsconfig.json that do not end with /index.ts. This is the case for projects running with tsx.
  20. v0.28.0

    Features 4, Fixes 4

    Notes
    Added
    • Schema definition for cds.typer options in package.json and .cdsrc-*.json files
    • Added a static elements property to all entities, which allows access to the LinkedDefinitions instance of an entity's elements
    • Schema definition for typescript cds build task.
    • .drafts property of any entity E is now of type DraftOf<E>, or DraftsOf<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 strict tsconfig.jsons
    • Properly support mandatory (not null) action parameters with array of types
    • Static property .drafts is only create for entity classes that are actually draft enabled
  21. v0.27.0

    Changed 2, Fixes 3

    Notes
    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, or notNull in CSN.
    Fixed
    • Fix build task for projects with spaces
    • Fix a bug where cds-typer would produce redundant type declarations when the model contains an associations to another entity's property
    • Reintroduce default value '.' for --outputDirectory
  22. v0.26.0

    Features 10

    Notes
    Added
    • Added a static .keys property in all entities. That property is dictionary which holds all properties as keys that are marked as key in CDS
    • Added a CLI option --useEntitiesProxy. When set to true, all entities are wrapped into Proxy 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 version 8.2 or higher.
    • Apps need to provide @cap-js/cds-types version 0.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}) and service.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
  23. v0.25.0

    Features 1, Changed 2, Fixes 1

    Notes
    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 using useDefineForClassFields or noImplicitOverride
    • 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.
  24. v0.24.0

    Changed 2, Fixes 2

    Notes
    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 of typescript
  25. v0.23.0

    Fixes 2

    Notes
    Fixed
    • Plurals no longer have is_singular attached in the resulting .js files
    • Properties are properly propagated beyond just one level of inheritance
  26. v0.22.0

    Changed 1, Fixes 1

    Notes
    Fixed
    • Fixed a bug where keys would sometimes inconsistently become nullable
    Changed
    • Logging now internally uses cds.log and pipes output into the cds-typer logger, which can be configured via cds.env in addition to explicitly passing a --logLevel parameter to CLI. Users now have to use the levels defined in cds.log.levels. The formerly valid levels WARNING, CRITICAL, and NONE are now deprecated and automatically mapped to valid levels for now.
  27. v0.21.2

    Fixes 1

    Notes
    Fixed
    • The typescript build task will no longer attempt to run unless at least cds 8 is installed
  28. v0.21.1

    Fixes 1

    Notes
    Fixed
    • Added missing cds-plugin.js to exported files to properly enable calling cds build --for typescript
  29. v0.21.0

    Features 2, Changed 3, Fixes 2

    Notes
    Added
    • Added IEEE754Compatible flag which, when set to true, generates decimal fields as (number | string) instead of number. This flag will be removed in the long run
    • Added plugin to cds build TypeScript projects. Can be explicitly called using cds build --for typescript
    Changed
    • Types representing CDS events are now only declared to avoid having to make their properties optional
    • Singular forms in generated index.js files now contain a .is_singular property as marker for distinguished handling of singular and plural in the runtime
    • Parameters passed to the CLI now take precedence over configuration contained in the typer section of cds.env
    Fixed
    • Entities ending with an "s" are no longer incorrectly truncated within extends-clauses
    • Entity names prefixed with their own namespace (e.g. Name.Name, Name.NameAttachments) are not stripped of their name prefix
  30. v0.20.2

    Fixes 1

    Notes
    Fixed
    • Referring to a property's type in a function/ action parameter no longer refers to the enclosing entity
  31. v0.20.1

    Fixes 1

    Notes
    Fixed
    • Void actions no longer crash the type generation process
  32. v0.20.0

    Features 3, Changed 1, Fixes 5

    Notes
    Added
    • Types for actions and functions now expose a .kind property which holds the string 'function' or 'action' respectively
    • Added the CdsDate, CdsDateTime, CdsTime, CdsTimestamp types, which are each represented as a string.
    • Plural types can now also contain an optional numeric $count property
    Changed
    • Empty .actions properties and operations without parameters are now typed as Record<never, never> to make it clear they contain nothing and also to satisfy overzealous linters
    Fixed
    • Composition of aspects now properly resolve implicit typeof references in their properties
    • Importing an enum into a service will now generate an alias to the original enum, instead of incorrectly duplicating the definition
    • Returning entities from actions/ functions and using them as parameters will now properly use the singular inflection instead of returning an array thereof
    • Aspects are now consistently named and called in their singular form
    • Only detect inflection clash if singular and plural share the same namespace. This also no longer reports sap.common as erroneous during type creation
  33. v0.19.0

    Features 1

    Notes
    Added
    • Support for cds.Vector, which will be represented as string
  34. v0.18.2

    Fixes 2

    Notes
    Fixed
    • Resolving @sap/cds will now look in the CWD first to ensure a consistent use the same CDS version across different setups
    • Types of function parameters starting with cds. are not automatically considered builtin anymore and receive a more thorough check against an allow-list
  35. v0.18.1

    Fixes 1

    Notes
    Fix
    • Remove faulty plural for CDS type definitions from the generated index.js files
  36. v0.18.0

    Features 1, Changed 1

    Notes
    Added
    • Improved support for projections, including projections on inline definitions, and on views, as well as support for explicit exclusion and selection of properties
    Changed
    • [breaking] CDS type definitions will not be inflected. Whatever inflection you define them in will be assumed treated as a singular form and will not receive a plural form anymore
  37. v0.17.0

    Fixes 1

    Notes
    Fixed
    • Fixed a bug where refering to an externally defined enum via the typeof syntax would crash the type generation
  38. v0.16.0

    Changed 3, Fixes 1

    Notes
    Changed
    • Changed default log level from NONE to ERROR. See the doc to manually pass in another log level for cds-typer runs
    • Name collisions between automatically generated foreign key fields (.…_ID, .…_code, etc.) with explicitly named fields will now raise an error
    • Generate CDS types that are actually structured types as if they were entities. This allows the correct representation of mixing aspects and types in CDS inheritance, and also fixes issues with inline enums in such types
    Fixed
    • Externally defined enums can now be used as parameter types in actions
  39. v0.15.0

    Features 2, Fixes 4

    Notes
    Added
    Fixed
    • Inline enums are now available during runtime as well
    • Inline enums can now be used as action parameter types as well. These enums will not have a runtime representation, but will only assert type safety!
    • Arrays of inline enum values can now be used as action parameters too. But they will only be represented by their enclosing type for now, i.e. string, number, etc.
    • Foreign keys of projection entities are now propagated as well
  40. v0.14.0

    Features 1

    Notes
    Added
    • Entities that are database views now also receive typings
  41. v0.13.0

    Features 1, Changed 1

    Notes
    Changed
    • Enums are now generated ecplicitly in the respective index.js files and don't have to extract their values from the model at runtime anymore
    Added
    • The excluding clause in projections now actually excludes the specified properties in the generated types
  42. v0.12.0

    Features 1, Changed 1, Fixes 1

    Notes
    Changed
    • Generate cds.LargeBinary as string, buffer, or readable in the case of media content
    Added
    • Added support for the not null modifier
    Fixed
    • Now using names of enum values in generated index.js files if no explicit value is present
  43. v0.11.1

    Features, Changed, Fixes 1

    Notes
    Changed
    Added
    Fixed
    • Fixed how service names are exported as default export
  44. v0.11.0dated in the atlas

    Removed 1, Features 3, Changed, Fixes 2

    Notes
    Changed
    Added
    • Autoexposed entities in services are now also generated
    • Each generated class now contains their original fully qualified name in a static .name property
    • Inline enums that are defined as literal type of properties are now supported as well (note: this feature is experimental. The location to which enums are generated might change in the future!)
    Fixed
    • Fixed an error when an entity uses type of on a property they have inherited from another entity
    • Fixed an error during draftability propagation when defining compositions on types that are declared inline
    Removed
    • compileFromCSN is no longer part of the package's API
  45. v0.10.0

    Features, Changed 1, Fixes

    Notes
    Changed
    • Actions and functions are now attached to a static .actions property of each generated class. This reflects the runtime behaviour better than the former way of generating instance methods
    Added
    Fixed
  46. v0.9.0

    Features 1, Changed, Fixes 1

    Notes
    Changed
    Added
    • Support for drafts via @odata.draft.enabled annotation
    Fixed
    • Foreign keys are now propagated more than one level (think: x_ID_ID_ID)
  47. v0.8.0

    Features, Changed, Fixes 2

    Notes
    Changed
    Added
    Fixed
    • Foreign keys that are inherited via aspects are now also generated in addition to the resolved property (see 0.7.0)
    • Explicitly annotated @singular and @plural names are now properly used in generated index.js files
  48. v0.7.0

    Features 2, Changed, Fixes

    Notes
    Changed
    Added
    • Support for [many] $self syntax in bound action parameters
    • Foreign keys are now present in the generated types in addition to the resolved property
    Fixed
  49. v0.6.1

    Features, Changed, Fixes 1

    Notes
    Changed
    Added
    Fixed
    • Removed a warning about circular imports
  50. v0.6.0

    Features 1, Fixes 3

    Notes
    Added
    • Support for event syntax
    Fixed
    • Initialise bound actions with stubs to support "strict":true in tsconfig.json
    • Add leading underscore to appease noUnusedParameters in strict tsconfigs
    • No longer inflect type definitions when they are referenced within entities or other type definitions
  51. v0.5.0

    Features 1, Changed 1, Fixes 2

    Notes
    Changed
    • Facilitate strict property checks. Note: checkJs: true must be present in the project's jsconfig.json or tsconfig.json respectively for this feature to become effective
    Added
    • Support for array of syntax
    Fixed
    • Generate string type for date-related types in CDS definitions
    • Generate Buffer | string type for the CDS type LargeBinary
  52. v0.4.0

    Features 1

    Notes
    Added
    • Support for enums when they are defined separately (not inline in the property type of an entity)
  53. v0.3.0

    Features 1, Changed 1, Fixes 1

    Notes
    Added
    • Support function definitions (apart from actions)
    Changed
    • Bump version to next minor
    Fixed
    • Properly import CDS type definitions when they are referenced elsewhere
  54. v0.2.5-beta.1

    Changed 1

    Notes
    Changed
    • Bump version
  55. v0.2.4

    Other 2

    Notes
    • Enable use of annotated singular/ plural names in associations/ compositions
    • Rename package from @sap/cds-dts-generator to @cap-js/cds-typer
  56. v0.2.3

    Other 1

    Notes
    • Add missing library files
  57. v0.2.2

    Other 1

    Notes
    • Make class hierarchy flatter
  58. v0.2.1

    Other 1

    Notes
    • Add missing files
  59. v0.2.0

    Other 10

    Notes
    • use native Typescript AST in unit tests
    • add propertiesOptional flag
    • support flat, as well as nested inline declarations
    • support typeof syntax
    • read rudimentary configuration from cds.env
    • export bound and unbound actions
    • allow inline type definitions within compositions
    • enable use of additional type libraries (HANA types available as first library)
    • provide proper JSDoc for all modules
    • export entity types for singular variants alongside plural types
  60. v0.1.1

    Other 2

    Notes
    • add TL;DR section to README
    • allow multiple positional arguments
  61. v0.1.0

    Other 1

    Notes
    • initial code base
15,230downloads per week, npm
Weekly downloads for @cap-js/cds-typer26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 15230.20 Apr – 26 Apr: 24,94827 Apr – 3 May: 22,2394 May – 10 May: 26,61511 May – 17 May: 28,25118 May – 24 May: 27,52825 May – 31 May: 27,5931 Jun – 7 Jun: 19,7798 Jun – 14 Jun: 26,46315 Jun – 21 Jun: 27,20222 Jun – 28 Jun: 26,20929 Jun – 5 Jul: 26,1206 Jul – 12 Jul: 24,21513 Jul – 19 Jul: 26,80020 Jul – 26 Jul: 31,93127 Jul – 2 Aug: 29,2343 Aug – 9 Aug: 27,94110 Aug – 16 Aug: 24,80417 Aug – 23 Aug: 29,77424 Aug – 30 Aug: 27,43931 Aug – 6 Sept: 22,7597 Sept – 13 Sept: 20,32814 Sept – 20 Sept: 25,04321 Sept – 27 Sept: 25,45728 Sept – 4 Oct: 26,2705 Oct – 11 Oct: 21,74012 Oct – 18 Oct: 15,230
Typing
  1. com.sap.cds:cds-maven-pluginMaven plugin running CDS build steps in a CAP Java projectfrom CAP
  2. @cap-js/cds-typesType definitions for the CAP Node.js SDKfrom CAP
  3. cds-internal-toolReusable internals for authors of CAP extensionsfrom CAP

Details

Sources5
npm registrydiscovered herechecked
GitHub APIdiscovered here, cap-jschecked
npm registry, @cap-js/cds-typerversion, releases, installschecked
github.com/git+https://github.com/cap-js/cds-typer.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
declared for>=8
latestv0.41.1
first release
releases and cadence55, ~28d median
discovered vianpm registry, GitHub API · cap-js
first seen in the atlas
ecosystem and domaincap, developer-experience
Contributors18
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:cap-js-cds-typer
JSON
/artifacts/cap-js-cds-typer.json
MCP
Connecting an agent