cap-js / cds-typer

CDS type generator for JavaScript
Apache License 2.0
29 stars 10 forks source link

[BUG] cds types not imported for events #382

Closed Janhouse closed 2 weeks ago

Janhouse commented 2 weeks ago

Seems like #40 forgot to add the functionality that imports cds base types when using events.

error TS2503: Cannot find namespace '__'.

// This is an automatically generated file. Please do not change its contents manually!
import cds from '@sap/cds'

export class EventService extends cds.Service {
}
export default EventService

// event
export declare class Created {
  declare DistributionChannel: string | null
  declare EventRaisedDateTime: __.CdsTimestamp | null
  declare OrganizationDivision: string | null
  declare Product: string | null
  declare SalesOrder: string | null
  declare SalesOrderItem: string | null
  declare SalesOrderItemCategory: string | null
  declare SalesOrderType: string | null
  declare SalesOrganization: string | null
  declare SoldToParty: string | null
}

__.CdsTimestamp is obviously not imported and throws the error.

Janhouse commented 2 weeks ago

Same problem with action