Skip to content

Commit

Permalink
change the visibility of Admin and Catalog services; regenerate snaps…
Browse files Browse the repository at this point in the history
…hots
  • Loading branch information
aramovic79 committed Nov 8, 2024
1 parent 4f4150c commit 67a004d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 64 deletions.
61 changes: 25 additions & 36 deletions __tests__/__snapshots__/ordCdsrc.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": [
Expand All @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
},
],
Expand All @@ -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",
Expand Down
59 changes: 32 additions & 27 deletions __tests__/__snapshots__/ordPackageJson.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": [
Expand All @@ -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",
},
],
Expand All @@ -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",
Expand All @@ -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",
},
],
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/bookshop/srv/admin-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -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'}]},
Expand Down
8 changes: 8 additions & 0 deletions __tests__/bookshop/srv/cat-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
};

0 comments on commit 67a004d

Please sign in to comment.