@@ -242,7 +242,9 @@ const createEntityTypeTemplate = (appConfig, packageIds, entity) => {
242242
243243function _handleVisibility ( ordExtensions , definition ) {
244244 let visibility ;
245- if ( ordExtensions . visibility ) {
245+ if ( isPrimaryDataProductService ( definition ) ) {
246+ visibility = RESOURCE_VISIBILITY . internal ;
247+ } else if ( ordExtensions . visibility ) {
246248 visibility = ordExtensions . visibility ;
247249 } else if ( definition [ ORD_EXTENSIONS_PREFIX + "visibility" ] ) {
248250 visibility = definition [ ORD_EXTENSIONS_PREFIX + "visibility" ] ;
@@ -307,9 +309,8 @@ const createAPIResourceTemplate = (serviceName, serviceDefinition, appConfig, pa
307309 ...ordExtensions ,
308310 } ;
309311
310- if ( serviceDefinition [ DATA_PRODUCT_ANNOTATION ] === DATA_PRODUCT_TYPE . primary ) {
312+ if ( isPrimaryDataProductService ( serviceDefinition ) ) {
311313 obj . apiProtocol = "rest" ;
312- obj . visibility = RESOURCE_VISIBILITY . internal ;
313314 obj . direction = "outbound" ;
314315 obj . implementationStandard = "sap.dp:data-subscription-api:v1" ;
315316 obj . entryPoints = [ ] ;
@@ -383,6 +384,10 @@ const createEventResourceTemplate = (serviceName, serviceDefinition, appConfig,
383384 : [ ] ;
384385} ;
385386
387+ function isPrimaryDataProductService ( serviceDefinition ) {
388+ return serviceDefinition [ DATA_PRODUCT_ANNOTATION ] === DATA_PRODUCT_TYPE . primary ;
389+ }
390+
386391function _getEntityTypeMappings ( definitionObj ) {
387392 if ( ! definitionObj . entities ) {
388393 return ;
0 commit comments