@ind-rcg/generator
Advanced tools
Comparing version 246.1021.0 to 248.1006.0
@@ -120,3 +120,2 @@ /* | ||
jsDocSource.push(this.getJsDocDescriptionElement("-> module: Use CORE or CUSTOM. If you are a Salesforce client or an implementation partner, always use CUSTOM to enable a seamless release upgrade.")); | ||
jsDocSource.push(this.getJsDocDescriptionElement("-> extends: Base class of the LO, BO, and LU objects that this function belongs to.")); | ||
jsDocSource.push(this.getJsDocDescriptionElement("-> maxRuntime: Maximum time this function is allowed to run, takes integer value in ms. If the max time is exceeded, error is logged.")); | ||
@@ -123,0 +122,0 @@ jsDocSource.push(this.getJsDocDescriptionElement("-> returns: Type and variable name in which the return value is stored.")); |
{ | ||
"name": "@ind-rcg/generator", | ||
"version": "246.1021.0", | ||
"version": "248.1006.0", | ||
"author": "Salesforce", | ||
@@ -12,3 +12,3 @@ "license": "BSD-3-Clause", | ||
"coverage": "nyc npm run testServer", | ||
"test_current": "mocha \"test/transform-test.js\"", | ||
"test_current": "mocha \"test/validator/validatorbase-test.js\"", | ||
"lint": "npx eslint *.js validator/*.js validator/**/*.js test/*.js test/**/*.js" | ||
@@ -44,6 +44,6 @@ }, | ||
"dependencies": { | ||
"@ind-rcg/plugins-printengine": "246.1010.0", | ||
"@ind-rcg/plugins-printengine": "248.1004.0", | ||
"bilby": "0.0.2", | ||
"comment-parser": "1.3.1", | ||
"crypto-js": "4.1.1", | ||
"crypto-js": "4.2.0", | ||
"escodegen": "2.0.0", | ||
@@ -50,0 +50,0 @@ "esprima": "4.0.1", |
@@ -13,3 +13,3 @@ /* | ||
let validatorUtil = require('../validatorUtil'); | ||
let { SEVERITY, DATASOURCE, FILE_NAME, CONTRACT_CATEGORY, CUSTOM_CONTRACT_INDICATOR, NAME_TAG} = require("../../globals"); | ||
let { SEVERITY, DATASOURCE, FILE_NAME, CONTRACT_CATEGORY, CUSTOM_CONTRACT_INDICATOR} = require("../../globals"); | ||
@@ -407,4 +407,4 @@ | ||
const nameAttr = xml.root()?.attr(NAME_TAG); | ||
checkNameAttr(nameAttr?.value(), nameAttr?.line(), validationResult, category); | ||
const nameDetails = validatorUtil.getDataSourceName(xml?.root()); | ||
checkNameAttr(nameDetails?.contractName, nameDetails?.line, validationResult, category); | ||
@@ -411,0 +411,0 @@ traverseAndValidateNodes(xml.root(), validationResult); |
@@ -15,3 +15,3 @@ /* | ||
let path = require('path'); | ||
const { BUSINESS_LOGIC_JS, DOMAIN_REPOSITORY, NEW_BL_LOGIC_FILE_ENDING, NAME_TAG} = require("../globals"); | ||
const { BUSINESS_LOGIC_JS, DOMAIN_REPOSITORY, NEW_BL_LOGIC_FILE_ENDING, NAME_TAG, IMAGE, ID_TAG, DATASOURCE} = require("../globals"); | ||
const validatorUtil = require("./validatorUtil"); | ||
@@ -309,18 +309,3 @@ const jsDocHelper = require('../jsDocHelper'); | ||
case "datasource":{ | ||
// v1 Datasource Ds + object class | ||
// v2 DataSource external | ||
let contractNameAttribute = rootNode.attr("name"); | ||
if (_.isNil(contractNameAttribute)) { | ||
// datasources exist in 3 different flavours: | ||
// v1 with the tag Datasource then it has no name but an object class | ||
// v2 with the tag DataSource then it has a name | ||
// external datasources | ||
contractNameAttribute = rootNode.attr("objectClass"); | ||
if (!_.isNil(contractNameAttribute)) { | ||
contractName = "Ds" + contractNameAttribute.value(); | ||
} | ||
} else { | ||
contractName = contractNameAttribute.value(); | ||
} | ||
contractName = validatorUtil.getDataSourceName(rootNode).contractName; | ||
break; | ||
@@ -617,2 +602,3 @@ } | ||
* @param {String} type contract type like datasource, userinterface | ||
* @param {String} content content of the contract | ||
* @param {String} contractPath | ||
@@ -622,10 +608,30 @@ * @param contractNameTypePathMap map to identify duplicate contract name and type combination | ||
*/ | ||
this.validateDuplicateName = (xml, type, contractPath, contractNameTypePathMap, error) => { | ||
const contractNameAttr = xml?.root()?.attr(NAME_TAG); | ||
const contractName = contractNameAttr?.value(); | ||
const mapKey = JSON.stringify({ contractName, type }); | ||
this.validateDuplicateName = (xml, type, content, contractPath, contractNameTypePathMap, error) => { | ||
let contractName, line, mapKey; | ||
if (type === BUSINESS_LOGIC_JS.FILETYPE) { | ||
const jsDoc = jsDocHelper.getJsDoc(content); | ||
const functionTag = _.find(jsDoc?.tags, {tag: 'function'}); | ||
const thisTag = _.find(jsDoc?.tags, {tag: 'this'}); | ||
const thisTagName = thisTag?.name; | ||
contractName = functionTag?.name; | ||
line = functionTag?.source[0]?.number + 1; | ||
mapKey = JSON.stringify({contractName, type, thisTagName}); | ||
} else { | ||
if (type === DATASOURCE.FILETYPE) { | ||
const nameDetails = validatorUtil.getDataSourceName(xml?.root()); | ||
contractName = nameDetails.contractName; | ||
line = nameDetails.line; | ||
} else { | ||
const nameTag = type === IMAGE.FILETYPE ? ID_TAG : NAME_TAG; | ||
const contractNameAttr = xml?.root()?.attr(nameTag); | ||
contractName = contractNameAttr?.value(); | ||
line = contractNameAttr?.line(); | ||
} | ||
mapKey = JSON.stringify({contractName, type}); | ||
} | ||
if (contractName && contractNameTypePathMap?.has(mapKey)) { | ||
error.result.push(validatorUtil.buildValidationMessage(3112691, | ||
`A duplicate of the ${contractName} contract exists at ${contractNameTypePathMap.get(mapKey)}. Delete one of the duplicate contracts.`, | ||
contractNameAttr.line(), SEVERITY.ERROR)); | ||
line, SEVERITY.ERROR)); | ||
} | ||
@@ -672,3 +678,3 @@ contractNameTypePathMap?.set(mapKey, contractPath); | ||
this.validateDuplicateName(xml, type, contractPath, contractNameTypePathMap, error); | ||
this.validateDuplicateName(xml, type, content, contractPath, contractNameTypePathMap, error); | ||
@@ -675,0 +681,0 @@ if (error.result.length > 0) { |
@@ -593,4 +593,25 @@ /* | ||
this.getDataSourceName = function (rootNode) { | ||
let contractName; | ||
// v1 Datasource Ds + object class | ||
// v2 DataSource external | ||
let contractNameAttribute = rootNode?.attr("name"); | ||
if (_.isNil(contractNameAttribute)) { | ||
// datasources exist in 3 different flavours: | ||
// v1 with the tag Datasource then it has no name but an object class | ||
// v2 with the tag DataSource then it has a name | ||
// external datasources | ||
contractNameAttribute = rootNode?.attr("objectClass"); | ||
if (!_.isNil(contractNameAttribute)) { | ||
contractName = "Ds" + contractNameAttribute.value(); | ||
} | ||
} else { | ||
contractName = contractNameAttribute.value(); | ||
} | ||
return {contractName, line : contractNameAttribute?.line()}; | ||
}; | ||
}(); | ||
module.exports = ValidatorUtil; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
849054
13541
+ Added@ind-rcg/plugins-printengine@248.1004.0(transitive)
+ Addedcrypto-js@4.2.0(transitive)
- Removed@ind-rcg/plugins-printengine@246.1010.0(transitive)
- Removedcrypto-js@4.1.1(transitive)
Updatedcrypto-js@4.2.0