New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cap-js/cds-typer

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cap-js/cds-typer - npm Package Versions

2345

0.33.0

Diff

Changelog

Source

[0.33.0] - 2025-02-10

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

cap-npm
published 0.32.1 •

Changelog

Source

[0.32.1] - 2025-01-20

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

cap-npm
published 0.32.0 •

Changelog

Source

[0.32.0] - 2025-01-14

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

cap-npm
published 0.31.0 •

Changelog

Source

[0.31.0] - 2024-12-16

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
cap-npm
published 0.30.0 •

Changelog

Source

[0.30.0] - 2024-12-02

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
cap-npm
published 0.29.0 •

Changelog

Source

[0.29.0] - 2024-11-20

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.
cap-npm
published 0.28.1 •

Changelog

Source

[0.28.1] - 2024-11-07

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.
cap-npm
published 0.28.0 •

Changelog

Source

[0.28.0] - 24-10-24

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
cap-npm
published 0.27.0 •

Changelog

Source

[0.27.0] - 2024-10-02

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
cap-npm
published 0.26.0 •

Changelog

Source

[0.26.0] - 2024-09-11

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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc