From 67a004d53e94c9dba87b955f5aecbb1e14f7710d Mon Sep 17 00:00:00 2001 From: Albin Ramovic Date: Fri, 8 Nov 2024 10:57:59 +0100 Subject: [PATCH] change the visibility of Admin and Catalog services; regenerate snapshots --- __tests__/__snapshots__/ordCdsrc.test.js.snap | 61 ++++++++----------- .../__snapshots__/ordPackageJson.test.js.snap | 59 ++++++++++-------- __tests__/bookshop/srv/admin-service.cds | 2 +- __tests__/bookshop/srv/cat-service.cds | 8 +++ 4 files changed, 66 insertions(+), 64 deletions(-) diff --git a/__tests__/__snapshots__/ordCdsrc.test.js.snap b/__tests__/__snapshots__/ordCdsrc.test.js.snap index 3898f66..3372c8c 100644 --- a/__tests__/__snapshots__/ordCdsrc.test.js.snap +++ b/__tests__/__snapshots__/ordCdsrc.test.js.snap @@ -6,27 +6,24 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully "apiResources": [ { "apiProtocol": "odata-v4", - "description": "Description for CatalogService", + "description": "Description for AdminService", "entityTypeMappings": [ { "entityTypeTargets": [ { - "ordId": "sap.odm:entityType:odm.bookshop.Authors:v1", + "ordId": "sap.odm:entityType:BusinessPartner:v1", }, ], }, ], "entryPoints": [ - "/browse", + "/odata/v4/admin", ], "extensible": { - "supported": "no", + "supported": "yes", }, "lastUpdate": "2024-11-04T14:33:25+01:00", - "ordId": "sap.test.cdsrc.sample:apiResource:CatalogService:v1", - "partOfGroups": [ - "sap.cds:service:sap.test.cdsrc.sample:CatalogService", - ], + "ordId": "sap.test.cdsrc.sample:apiResource:AdminService:v1", "partOfPackage": "sap.test.cdsrc.sample:package:capirebookshopordsample-api:v1", "releaseStatus": "active", "resourceDefinitions": [ @@ -38,7 +35,7 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully ], "mediaType": "application/json", "type": "openapi-v3", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.oas3.json", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.oas3.json", }, { "accessStrategies": [ @@ -48,29 +45,14 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully ], "mediaType": "application/xml", "type": "edmx", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.edmx", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.edmx", }, ], - "shortDescription": "Short description for CatalogService", - "title": "CatalogService", - "version": "1.0.0", + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", "visibility": "public", }, - { - "entityTypeMappings": [ - { - "entityTypeTargets": [ - { - "ordId": "sap.odm:entityType:BusinessPartner:v1", - }, - ], - }, - ], - "extensible": { - "supported": "yes", - }, - "ordId": "sap.test.cdsrc.sample:apiResource:AdminService:v1", - }, ], "consumptionBundles": [ { @@ -112,13 +94,20 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully "eventResources": [ { "description": "CAP Event resource describing events / messages.", + "entityTypeMappings": { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1", + }, + ], + }, "extensible": { - "supported": "no", + "supported": "yes", }, "lastUpdate": "2024-11-04T14:33:25+01:00", - "ordId": "sap.test.cdsrc.sample:eventResource:CatalogService:v1", + "ordId": "sap.test.cdsrc.sample:eventResource:AdminService:v1", "partOfGroups": [ - "sap.cds:service:sap.test.cdsrc.sample:CatalogService", + "sap.cds:service:sap.test.cdsrc.sample:AdminService", ], "partOfPackage": "sap.test.cdsrc.sample:package:capirebookshopordsample-event:v1", "releaseStatus": "active", @@ -131,12 +120,12 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully ], "mediaType": "application/json", "type": "asyncapi-v2", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.asyncapi2.json", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.asyncapi2.json", }, ], - "shortDescription": "CatalogService event resource", - "title": "ODM capirebookshopordsample Events", - "version": "1.0.0", + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", "visibility": "public", }, ], @@ -149,7 +138,7 @@ exports[`Tests for default ORD document when .cdsrc.json is present Successfully { "groupId": "sap.cds:service:sap.test.cdsrc.sample:CatalogService", "groupTypeId": "sap.cds:service", - "title": "Catalog Service", + "title": "This is test Catalog Service title", }, ], "openResourceDiscovery": "1.10", diff --git a/__tests__/__snapshots__/ordPackageJson.test.js.snap b/__tests__/__snapshots__/ordPackageJson.test.js.snap index 182bddd..5a40632 100644 --- a/__tests__/__snapshots__/ordPackageJson.test.js.snap +++ b/__tests__/__snapshots__/ordPackageJson.test.js.snap @@ -6,26 +6,24 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf "apiResources": [ { "apiProtocol": "odata-v4", - "description": "Description for CatalogService", - "entityTypeMappings": [ - { - "entityTypeTargets": [ - { - "ordId": "sap.odm:entityType:odm.bookshop.Authors:v1", - }, - ], - }, - ], + "description": "Description for AdminService", + "entityTypeMappings": { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1", + }, + ], + }, "entryPoints": [ - "/browse", + "/odata/v4/admin", ], "extensible": { - "supported": "no", + "supported": "yes", }, "lastUpdate": "2024-11-04T14:33:25+01:00", - "ordId": "customer.capirebookshopordsample:apiResource:CatalogService:v1", + "ordId": "customer.capirebookshopordsample:apiResource:AdminService:v1", "partOfGroups": [ - "sap.cds:service:customer.capirebookshopordsample:CatalogService", + "sap.cds:service:customer.capirebookshopordsample:AdminService", ], "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", "releaseStatus": "active", @@ -38,7 +36,7 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf ], "mediaType": "application/json", "type": "openapi-v3", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.oas3.json", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.oas3.json", }, { "accessStrategies": [ @@ -48,12 +46,12 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf ], "mediaType": "application/xml", "type": "edmx", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.edmx", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.edmx", }, ], - "shortDescription": "Short description for CatalogService", - "title": "CatalogService", - "version": "1.0.0", + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", "visibility": "public", }, ], @@ -71,13 +69,20 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf "eventResources": [ { "description": "CAP Event resource describing events / messages.", + "entityTypeMappings": { + "entityTypeTargets": [ + { + "ordId": "sap.odm:entityType:test-from-extension:v1", + }, + ], + }, "extensible": { - "supported": "no", + "supported": "yes", }, "lastUpdate": "2024-11-04T14:33:25+01:00", - "ordId": "customer.capirebookshopordsample:eventResource:CatalogService:v1", + "ordId": "customer.capirebookshopordsample:eventResource:AdminService:v1", "partOfGroups": [ - "sap.cds:service:customer.capirebookshopordsample:CatalogService", + "sap.cds:service:customer.capirebookshopordsample:AdminService", ], "partOfPackage": "customer.capirebookshopordsample:package:capirebookshopordsample:v1", "releaseStatus": "active", @@ -90,12 +95,12 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf ], "mediaType": "application/json", "type": "asyncapi-v2", - "url": "/.well-known/open-resource-discovery/v1/api-metadata/CatalogService.asyncapi2.json", + "url": "/.well-known/open-resource-discovery/v1/api-metadata/AdminService.asyncapi2.json", }, ], - "shortDescription": "CatalogService event resource", - "title": "ODM capirebookshopordsample Events", - "version": "1.0.0", + "shortDescription": "short description for test AdminService", + "title": "This is test AdminService title", + "version": "2.0.0", "visibility": "public", }, ], @@ -108,7 +113,7 @@ exports[`Tests for default ORD document when .cdsrc.json is not present Successf { "groupId": "sap.cds:service:customer.capirebookshopordsample:CatalogService", "groupTypeId": "sap.cds:service", - "title": "Catalog Service", + "title": "This is test Catalog Service title", }, ], "openResourceDiscovery": "1.9", diff --git a/__tests__/bookshop/srv/admin-service.cds b/__tests__/bookshop/srv/admin-service.cds index 4d1ff55..0af736a 100644 --- a/__tests__/bookshop/srv/admin-service.cds +++ b/__tests__/bookshop/srv/admin-service.cds @@ -25,7 +25,7 @@ service AdminService @(requires: 'authenticated-user') { annotate AdminService with @ORD.Extensions: { title : 'This is test AdminService title', shortDescription : 'short description for test AdminService', - visibility : 'private', + visibility : 'public', version : '2.0.0', extensible : {supported: 'yes'}, entityTypeMappings: {entityTypeTargets: [{ordId: 'sap.odm:entityType:test-from-extension:v1'}]}, diff --git a/__tests__/bookshop/srv/cat-service.cds b/__tests__/bookshop/srv/cat-service.cds index d8d8c0b..739ff07 100644 --- a/__tests__/bookshop/srv/cat-service.cds +++ b/__tests__/bookshop/srv/cat-service.cds @@ -30,3 +30,11 @@ service CatalogService @(path: '/browse') { title : String @title: 'Title'; } } + +annotate CatalogService with @ORD.Extensions: { + title : 'This is test Catalog Service title', + shortDescription : 'short description for test CatalogService', + visibility : 'internal', + version : '2.0.0', + extensible : {supported: 'yes'} +}; \ No newline at end of file