diff --git a/apis/linked.d.ts b/apis/linked.d.ts index 8c4ed156..fbb78dfc 100644 --- a/apis/linked.d.ts +++ b/apis/linked.d.ts @@ -2,6 +2,7 @@ import * as csn from './csn' import { IterableMap } from './internal/util' import { Definitions, any_, entity, service_ } from './linked/classes' +// TODO: the function usage for services is not documented and will be removed with cds^10 export type ModelPart = IterableMap & ((namespace: string) => IterableMap) type Visitor = (def: any_, name: string, parent: any_, defs: Definitions) => void type Filter = string | ((def: T) => boolean) diff --git a/test/typescript/apis/project/cds-services.ts b/test/typescript/apis/project/cds-services.ts index 5442e069..e1054f08 100644 --- a/test/typescript/apis/project/cds-services.ts +++ b/test/typescript/apis/project/cds-services.ts @@ -24,10 +24,16 @@ cds.connect({kind: 'odata', model:'some/imported/model', service: 'BusinessPartn // basic properties srv.name.length srv.entities[0] = Books // same type +srv.events[0] = ??? +srv.types[0] = ??? +srv.actions[0] = ??? + +// TODO: function usage was never official, is now deprecated, and will be removed with cds^10 srv.entities('namespace') srv.events('namespace') srv.types('namespace') -srv.operations('namespace') +srv.operations('namespace') //> should be .actions() +srv.actions('namespace') await srv.init() @@ -469,6 +475,14 @@ srv.entities('namespace'); // @ts-expect-error srv.entities('namespace')('and again') +// TODO: function usage was never official, is now deprecated, and will be removed with cds^10 +// @ts-expect-deprecated -> is there such a thing? :D +srv.entities('namespace') +srv.events('namespace') +srv.types('namespace') +srv.operations('namespace') //> should be .actions() +srv.actions('namespace') + type ActionType = HandlerFunction srv.on(unboundAction, externalActionHandler) function externalActionHandler(req: ActionType['parameters']['req']): ActionType['returns'] { @@ -499,4 +513,4 @@ asrv.on('', (req) => { asrv.dispatch([req]) }) asrv.dispatch('foo') -asrv.dispatch(['foo', 'bar']) \ No newline at end of file +asrv.dispatch(['foo', 'bar'])