From 10ee8c2ce5e7c755f0d8c3e47164dad5f17c9f44 Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:18:11 +0100 Subject: [PATCH 1/3] fix: `srv.entities('namespace')` is not an official API and will be removed in cds^10 --- test/typescript/apis/project/cds-services.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/typescript/apis/project/cds-services.ts b/test/typescript/apis/project/cds-services.ts index 5442e069..d0547d75 100644 --- a/test/typescript/apis/project/cds-services.ts +++ b/test/typescript/apis/project/cds-services.ts @@ -24,7 +24,6 @@ cds.connect({kind: 'odata', model:'some/imported/model', service: 'BusinessPartn // basic properties srv.name.length srv.entities[0] = Books // same type -srv.entities('namespace') srv.events('namespace') srv.types('namespace') srv.operations('namespace') @@ -499,4 +498,4 @@ asrv.on('', (req) => { asrv.dispatch([req]) }) asrv.dispatch('foo') -asrv.dispatch(['foo', 'bar']) \ No newline at end of file +asrv.dispatch(['foo', 'bar']) From 03e6cf822b7817d38eeed101cf7b1b1aa133fdb0 Mon Sep 17 00:00:00 2001 From: D050513 Date: Thu, 30 Oct 2025 11:52:13 +0100 Subject: [PATCH 2/3] comments --- apis/linked.d.ts | 1 + test/typescript/apis/project/cds-services.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 d0547d75..d9b6e32e 100644 --- a/test/typescript/apis/project/cds-services.ts +++ b/test/typescript/apis/project/cds-services.ts @@ -24,9 +24,13 @@ cds.connect({kind: 'odata', model:'some/imported/model', service: 'BusinessPartn // basic properties srv.name.length srv.entities[0] = Books // same type + +// 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() @@ -468,6 +472,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'] { From 47cfd7b40c71411800dbf66b4ad1ae0614488d50 Mon Sep 17 00:00:00 2001 From: D050513 Date: Thu, 30 Oct 2025 11:53:57 +0100 Subject: [PATCH 3/3] enumerable access --- test/typescript/apis/project/cds-services.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/typescript/apis/project/cds-services.ts b/test/typescript/apis/project/cds-services.ts index d9b6e32e..e1054f08 100644 --- a/test/typescript/apis/project/cds-services.ts +++ b/test/typescript/apis/project/cds-services.ts @@ -24,6 +24,9 @@ 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')