diff --git a/lib/ord.js b/lib/ord.js index 96b3997..b662923 100644 --- a/lib/ord.js +++ b/lib/ord.js @@ -28,13 +28,13 @@ const fInitializeGlobal = (csn) => { const aEvents = []; const aServices = []; const aODMEntity = []; - + const capNamespace = csn.namespace; // namespace variable value if present in cdsrc.json take it there or else from package.json //if cdsrc.json does not have applicationNamespace, then use just the namespace const namespace = cds.env["ord"]?.namespace || packageName.replace(/[^\w/]/g, "").replace(/\//, "."); const applicationNamespace = cds.env?.export?.asyncapi?.applicationNamespace; - + if (applicationNamespace && fGetNamespaceComponents(namespace) !== fGetNamespaceComponents(applicationNamespace)) { console.warn('ORD and AsyncAPI namespaces should be the same.'); } @@ -105,7 +105,7 @@ const fGetProducts = (global) => global.env?.products || defaults.products(globa /** * Retrieves the groups that services belongs to. * Gets list of groups from CDS runtime object. - * @param {Object} csn object + * @param {Object} csn object * @returns {Array} The groups array. */ const fGetGroups = (csn, global) => { @@ -116,7 +116,7 @@ const fGetGroups = (csn, global) => { /** * Retrieves the packages. - * Hierarchy to check data: cdsrc.json > defaults + * Hierarchy to check data: cdsrc.json > defaults. TODO: Check if this is still valid. * @returns {Array} The packages array. */ const fGetPackages = (policyLevel,global) => global.env?.packages || (global.aEvents.length) ? defaults.packages(global.namespace,policyLevel,global.capNamespace) : defaults.packages(global.namespace,policyLevel,global.capNamespace).slice(0, 1)