@sap/cds-compiler 5.8.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/bin/cds_remove_invalid_whitespace.js +5 -3
- package/bin/cds_update_identifiers.js +9 -6
- package/bin/cdsc.js +79 -59
- package/bin/cdsse.js +14 -10
- package/bin/cdsv2m.js +3 -1
- package/lib/api/options.js +28 -6
- package/lib/base/message-registry.js +15 -4
- package/lib/checks/validator.js +3 -0
- package/lib/compiler/base.js +1 -1
- package/lib/compiler/checks.js +70 -50
- package/lib/compiler/extend.js +1 -1
- package/lib/compiler/generate.js +8 -2
- package/lib/compiler/index.js +1 -1
- package/lib/compiler/lsp-api.js +1 -1
- package/lib/compiler/propagator.js +2 -2
- package/lib/compiler/resolve.js +78 -31
- package/lib/compiler/shared.js +3 -3
- package/lib/compiler/tweak-assocs.js +1 -1
- package/lib/compiler/utils.js +10 -0
- package/lib/compiler/xpr-rewrite.js +1 -1
- package/lib/edm/annotations/edmJson.js +42 -39
- package/lib/edm/annotations/genericTranslation.js +55 -55
- package/lib/edm/annotations/preprocessAnnotations.js +5 -5
- package/lib/edm/csn2edm.js +21 -16
- package/lib/edm/edm.js +62 -62
- package/lib/edm/edmAnnoPreprocessor.js +2 -2
- package/lib/edm/edmInboundChecks.js +1 -1
- package/lib/edm/edmPreprocessor.js +32 -32
- package/lib/edm/edmUtils.js +8 -8
- package/lib/gen/CdlGrammar.checksum +1 -1
- package/lib/gen/CdlParser.js +77 -81
- package/lib/gen/Dictionary.json +3062 -3072
- package/lib/gen/language.checksum +1 -1
- package/lib/gen/language.interp +1 -1
- package/lib/gen/languageParser.js +1238 -1236
- package/lib/json/from-csn.js +1 -1
- package/lib/json/to-csn.js +30 -3
- package/lib/language/genericAntlrParser.js +16 -0
- package/lib/main.d.ts +79 -1
- package/lib/model/csnRefs.js +12 -5
- package/lib/model/xprAsTree.js +71 -0
- package/lib/modelCompare/utils/filter.js +1 -1
- package/lib/optionProcessor.js +46 -32
- package/lib/parsers/CdlGrammar.g4 +33 -28
- package/lib/parsers/Lexer.js +1 -1
- package/lib/parsers/XprTree.js +25 -16
- package/lib/render/toCdl.js +902 -414
- package/lib/render/toHdbcds.js +1 -1
- package/lib/render/toSql.js +8 -0
- package/lib/render/utils/common.js +2 -2
- package/lib/render/utils/operators.js +160 -0
- package/lib/render/utils/pretty.js +337 -0
- package/lib/sql-identifier.js +7 -9
- package/lib/transform/addTenantFields.js +39 -41
- package/lib/transform/db/applyTransformations.js +4 -4
- package/lib/transform/db/assertUnique.js +6 -5
- package/lib/transform/db/associations.js +3 -3
- package/lib/transform/db/assocsToQueries/transformExists.js +13 -13
- package/lib/transform/db/assocsToQueries/utils.js +8 -0
- package/lib/transform/db/backlinks.js +19 -14
- package/lib/transform/db/constraints.js +6 -6
- package/lib/transform/db/expansion.js +1 -1
- package/lib/transform/db/flattening.js +2 -2
- package/lib/transform/db/groupByOrderBy.js +1 -1
- package/lib/transform/db/processSqlServices.js +3 -3
- package/lib/transform/db/rewriteCalculatedElements.js +2 -2
- package/lib/transform/db/temporal.js +7 -9
- package/lib/transform/db/views.js +6 -6
- package/lib/transform/draft/odata.js +2 -0
- package/lib/transform/effective/annotations.js +1 -1
- package/lib/transform/effective/associations.js +1 -1
- package/lib/transform/effective/main.js +1 -0
- package/lib/transform/effective/service.js +2 -2
- package/lib/transform/forRelationalDB.js +11 -5
- package/lib/transform/localized.js +2 -0
- package/lib/transform/odata/adaptAnnotationRefs.js +10 -9
- package/lib/transform/odata/createForeignKeys.js +1 -1
- package/lib/transform/odata/flattening.js +2 -1
- package/lib/transform/parseExpr.js +2 -2
- package/lib/transform/transformUtils.js +9 -7
- package/lib/transform/translateAssocsToJoins.js +0 -2
- package/lib/transform/universalCsn/coreComputed.js +2 -2
- package/lib/utils/moduleResolve.js +7 -5
- package/package.json +1 -1
- package/share/messages/def-upcoming-virtual-change.md +55 -0
- package/share/messages/file-unexpected-case-mismatch.md +61 -0
- package/share/messages/message-explanations.json +2 -0
- package/lib/transform/braceExpression.js +0 -77
|
@@ -23,7 +23,7 @@ const NavResAnno = '@Capabilities.NavigationRestrictions.RestrictedProperties';
|
|
|
23
23
|
const capabilities = Object.keys(require('../gen/Dictionary.json')
|
|
24
24
|
.types['Capabilities.NavigationPropertyRestriction'].Properties)
|
|
25
25
|
.filter(c => ![ 'NavigationProperty', 'Navigability' ].includes(c))
|
|
26
|
-
.map(c => `@Capabilities.${c}`);
|
|
26
|
+
.map(c => `@Capabilities.${ c }`);
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* edmPreprocessor warms up the model so that it can be converted into an EDM document and
|
|
@@ -126,7 +126,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
126
126
|
// sort schemas in reverse order to allow longest match in whatsMySchemaName function
|
|
127
127
|
schemaNames.sort((a, b) => b.length - a.length);
|
|
128
128
|
function whatsMySchemaName( n ) {
|
|
129
|
-
return schemaNames.reduce((rc, sn) => (!rc && n && n.startsWith(`${sn}.`) ? sn : rc), undefined);
|
|
129
|
+
return schemaNames.reduce((rc, sn) => (!rc && n && n.startsWith(`${ sn }.`) ? sn : rc), undefined);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
if (schemaNames.length) {
|
|
@@ -231,7 +231,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
231
231
|
const p = artName.split('.');
|
|
232
232
|
return p.length === 2 && p[0] === fbSchemaName;
|
|
233
233
|
}))
|
|
234
|
-
fbSchemaName = `root${i++}`;
|
|
234
|
+
fbSchemaName = `root${ i++ }`;
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
return [
|
|
@@ -239,7 +239,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
239
239
|
srootNames,
|
|
240
240
|
fbSchemaName,
|
|
241
241
|
// whatsMyServiceRootName
|
|
242
|
-
( n, self = true ) => srootNames.reduce((rc, sn) => (!rc && n && n.startsWith(`${sn}.`) || (n === sn && self) ? sn : rc), undefined),
|
|
242
|
+
( n, self = true ) => srootNames.reduce((rc, sn) => (!rc && n && n.startsWith(`${ sn }.`) || (n === sn && self) ? sn : rc), undefined),
|
|
243
243
|
];
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -274,7 +274,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
274
274
|
// if this definition has a root def and the root def is not the service/schema name
|
|
275
275
|
// => service C { type D.E }, replace the prefix dots with underscores
|
|
276
276
|
if (rootDef && defName !== rootDef && rootDef !== edmUtils.getSchemaPrefix(defName)) {
|
|
277
|
-
const newDefName = `${rootDef}.${defName.replace(`${rootDef}.`, '').replace(/\./g, '_')}`;
|
|
277
|
+
const newDefName = `${ rootDef }.${ defName.replace(`${ rootDef }.`, '').replace(/\./g, '_') }`;
|
|
278
278
|
// store renamed types in correlation maps for later renaming
|
|
279
279
|
if (def.kind === 'entity')
|
|
280
280
|
dotEntityNameMap[defName] = newDefName;
|
|
@@ -390,7 +390,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
390
390
|
if (!target.$sources)
|
|
391
391
|
setProp(target, '$sources', Object.create(null));
|
|
392
392
|
|
|
393
|
-
target.$sources[`${struct.name}.${name}`] = element;
|
|
393
|
+
target.$sources[`${ struct.name }.${ name }`] = element;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
else {
|
|
@@ -506,8 +506,8 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
506
506
|
// Backlink Navigation Property "Parameters" to <ViewName>Parameters
|
|
507
507
|
|
|
508
508
|
// this code can be extended for aggregated views
|
|
509
|
-
const typeEntityName = `${entityName}Type`;
|
|
510
|
-
const typeEntitySetName = `${entityName}Set`;
|
|
509
|
+
const typeEntityName = `${ entityName }Type`;
|
|
510
|
+
const typeEntitySetName = `${ entityName }Set`;
|
|
511
511
|
const typeToParameterAssocName = 'Parameters';
|
|
512
512
|
const hasBacklink = true;
|
|
513
513
|
|
|
@@ -554,7 +554,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
function createParameterEntity( entityCsn, entityName, isProxy ) {
|
|
557
|
-
const parameterEntityName = `${entityName}Parameters`;
|
|
557
|
+
const parameterEntityName = `${ entityName }Parameters`;
|
|
558
558
|
const parameterToTypeAssocName = 'Set';
|
|
559
559
|
|
|
560
560
|
// Construct the parameter entity
|
|
@@ -902,7 +902,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
902
902
|
warning('odata-unexpected-cardinality', element.$path, {
|
|
903
903
|
value: srcMult,
|
|
904
904
|
othervalue: newMult,
|
|
905
|
-
name: `${partnerCsn._parent.name}/${partnerCsn.name}`,
|
|
905
|
+
name: `${ partnerCsn._parent.name }/${ partnerCsn.name }`,
|
|
906
906
|
}, 'Explicit source cardinality $(VALUE) of $(NAME) conflicts with target cardinality $(OTHERVALUE)' );
|
|
907
907
|
}
|
|
908
908
|
}
|
|
@@ -931,8 +931,8 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
931
931
|
if (options.odataXServiceRefs && options.isV4()) {
|
|
932
932
|
serviceRootNames.forEach((srn) => {
|
|
933
933
|
schemaNames.forEach((fqSchemaName) => {
|
|
934
|
-
if (fqSchemaName.startsWith(`${srn}.`)) {
|
|
935
|
-
const targetSchemaName = fqSchemaName.replace(`${srn}.`, '');
|
|
934
|
+
if (fqSchemaName.startsWith(`${ srn }.`)) {
|
|
935
|
+
const targetSchemaName = fqSchemaName.replace(`${ srn }.`, '');
|
|
936
936
|
if (serviceRootNames.includes(targetSchemaName)) {
|
|
937
937
|
// remove all definitions starting with < fqSchemaName >. and add a schema reference
|
|
938
938
|
forEachKey(csn.definitions, (dn) => {
|
|
@@ -1081,7 +1081,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1081
1081
|
}
|
|
1082
1082
|
|
|
1083
1083
|
function createSchemaRefFor( targetSchemaName ) {
|
|
1084
|
-
let ref = csn.definitions[`${globalSchemaPrefix}.${targetSchemaName}`];
|
|
1084
|
+
let ref = csn.definitions[`${ globalSchemaPrefix }.${ targetSchemaName }`];
|
|
1085
1085
|
if (!ref)
|
|
1086
1086
|
ref = edmUtils.createSchemaRef(serviceRoots, targetSchemaName);
|
|
1087
1087
|
|
|
@@ -1101,12 +1101,12 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1101
1101
|
// 1) construct the proxy definition
|
|
1102
1102
|
// proxyDefinitionName: strip the serviceName and replace '.' with '_'
|
|
1103
1103
|
const defName
|
|
1104
|
-
= `${assoc._target.name.replace(`${proxySchemaName}.`, '').replace(/\./g, '_')}`;
|
|
1104
|
+
= `${ assoc._target.name.replace(`${ proxySchemaName }.`, '').replace(/\./g, '_') }`;
|
|
1105
1105
|
|
|
1106
1106
|
// fullName: Prepend serviceName and if in same service add '_proxy'
|
|
1107
1107
|
const proxy = isParamProxy
|
|
1108
|
-
? createParameterEntity(assoc._target, `${proxySchemaName}.${defName}`, true)
|
|
1109
|
-
: { name: `${proxySchemaName}.${defName}`, kind: 'entity', elements: Object.create(null) };
|
|
1108
|
+
? createParameterEntity(assoc._target, `${ proxySchemaName }.${ defName }`, true)
|
|
1109
|
+
: { name: `${ proxySchemaName }.${ defName }`, kind: 'entity', elements: Object.create(null) };
|
|
1110
1110
|
|
|
1111
1111
|
// Final proxyShortName for all further processing
|
|
1112
1112
|
const proxyShortName = defName + (isParamProxy ? 'Parameters' : '');
|
|
@@ -1177,7 +1177,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1177
1177
|
// argument proxySchemaName forces an anonymous type definition for newElt into the
|
|
1178
1178
|
// proxy schema. If omitted, this exposure defaults to 'root', in case API flavor
|
|
1179
1179
|
// of the day changes...
|
|
1180
|
-
exposeStructTypeForProxyOf(newElt, `${proxy.$proxyShortName}_${newElt.name}`,
|
|
1180
|
+
exposeStructTypeForProxyOf(newElt, `${ proxy.$proxyShortName }_${ newElt.name }`,
|
|
1181
1181
|
proxy.$mySchemaName, newElt.key, !!(newElt.key && newElt.elements));
|
|
1182
1182
|
}
|
|
1183
1183
|
if (newElt.key)
|
|
@@ -1225,11 +1225,11 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1225
1225
|
if (node.type) {
|
|
1226
1226
|
// same as for proxies, use schema or namespace, 'root' is last resort
|
|
1227
1227
|
typeSchemaName = typeDef.$mySchemaName || edmUtils.getSchemaPrefix(node.type);
|
|
1228
|
-
typeId = node.type.replace(`${typeSchemaName}.`, '').replace(/\./g, '_');
|
|
1228
|
+
typeId = node.type.replace(`${ typeSchemaName }.`, '').replace(/\./g, '_');
|
|
1229
1229
|
// strip the service root of that type (if any)
|
|
1230
1230
|
const myServiceRootName = whatsMyServiceRootName(typeSchemaName);
|
|
1231
1231
|
if (myServiceRootName)
|
|
1232
|
-
typeSchemaName = typeSchemaName.replace(`${myServiceRootName}.`, '');
|
|
1232
|
+
typeSchemaName = typeSchemaName.replace(`${ myServiceRootName }.`, '');
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
1235
1235
|
if (edmUtils.isStructuredArtifact(typeDef)) {
|
|
@@ -1237,7 +1237,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1237
1237
|
// only toplevel nodes (elements) can be key
|
|
1238
1238
|
forceToNotNull = !!(forceToNotNull && isKey && node.elements && !node.type);
|
|
1239
1239
|
|
|
1240
|
-
typeClone = cloneStructTypeForProxy(`${typeSchemaName}.${typeId}`);
|
|
1240
|
+
typeClone = cloneStructTypeForProxy(`${ typeSchemaName }.${ typeId }`);
|
|
1241
1241
|
if (typeClone) {
|
|
1242
1242
|
// Recurse into elements of 'type' (if any)
|
|
1243
1243
|
if (typeClone.elements) {
|
|
@@ -1249,7 +1249,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1249
1249
|
// TODO: expose types of assoc.keys and don't rely on exposed foreign keys
|
|
1250
1250
|
if (!elem['@odata.foreignKey4'] ||
|
|
1251
1251
|
(elem['@odata.foreignKey4'] && !typeClone.elements[elem['@odata.foreignKey4']].$exposed)) {
|
|
1252
|
-
exposeStructTypeForProxyOf(elem, `${typeId}_${elemName}`,
|
|
1252
|
+
exposeStructTypeForProxyOf(elem, `${ typeId }_${ elemName }`,
|
|
1253
1253
|
typeSchemaName, isKey, forceToNotNull);
|
|
1254
1254
|
}
|
|
1255
1255
|
});
|
|
@@ -1446,7 +1446,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1446
1446
|
setProp(proxy, '$globalSchemaPrefix', globalSchemaPrefix);
|
|
1447
1447
|
setProp(proxy, '$origin', element);
|
|
1448
1448
|
|
|
1449
|
-
const fqProxyName = `${proxy.$globalSchemaPrefix}.${proxy.name}`;
|
|
1449
|
+
const fqProxyName = `${ proxy.$globalSchemaPrefix }.${ proxy.name }`;
|
|
1450
1450
|
|
|
1451
1451
|
if (!element._target.$cachedProxy)
|
|
1452
1452
|
edmUtils.assignProp(element._target, '$cachedProxy', Object.create(null));
|
|
@@ -1465,8 +1465,8 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1465
1465
|
|
|
1466
1466
|
function mergeProxiesIntoModel() {
|
|
1467
1467
|
proxyCache.forEach((proxy) => {
|
|
1468
|
-
const fqProxyName = `${proxy.$globalSchemaPrefix}.${proxy.name}`;
|
|
1469
|
-
const fqSchemaName = `${proxy.$globalSchemaPrefix}.${proxy.$mySchemaName}`;
|
|
1468
|
+
const fqProxyName = `${ proxy.$globalSchemaPrefix }.${ proxy.name }`;
|
|
1469
|
+
const fqSchemaName = `${ proxy.$globalSchemaPrefix }.${ proxy.$mySchemaName }`;
|
|
1470
1470
|
|
|
1471
1471
|
if (proxy.kind === 'entity') {
|
|
1472
1472
|
finalizeProxyContainments(proxy);
|
|
@@ -1478,7 +1478,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1478
1478
|
// followed by all namespaces that are potentially exposed by the exposed types
|
|
1479
1479
|
// don't forget to prepend the global namespace prefix
|
|
1480
1480
|
// schemas are ordered in csn2edm.js for each service
|
|
1481
|
-
forEachKey(proxy.$exposedTypes, t => schemaSet.add(`${proxy.$globalSchemaPrefix}.${edmUtils.getSchemaPrefix(t)}`));
|
|
1481
|
+
forEachKey(proxy.$exposedTypes, t => schemaSet.add(`${ proxy.$globalSchemaPrefix }.${ edmUtils.getSchemaPrefix(t) }`));
|
|
1482
1482
|
schemaSet.forEach((schemaName) => {
|
|
1483
1483
|
if (!schemas[schemaName]) {
|
|
1484
1484
|
schemas[schemaName] = { kind: 'schema', name: schemaName };
|
|
@@ -1491,7 +1491,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1491
1491
|
reqDefs.definitions[fqProxyName] = proxy;
|
|
1492
1492
|
setProp(proxy, '$path', [ 'definitions', fqProxyName ]);
|
|
1493
1493
|
forEach(proxy.$exposedTypes, ( tn, v ) => {
|
|
1494
|
-
const fqtn = `${proxy.$globalSchemaPrefix}.${tn}`;
|
|
1494
|
+
const fqtn = `${ proxy.$globalSchemaPrefix }.${ tn }`;
|
|
1495
1495
|
if (csn.definitions[fqtn] === undefined) {
|
|
1496
1496
|
csn.definitions[fqtn] = v;
|
|
1497
1497
|
reqDefs.definitions[fqtn] = v;
|
|
@@ -1621,7 +1621,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1621
1621
|
if (newRefs.length) {
|
|
1622
1622
|
keyPaths.push(...newRefs);
|
|
1623
1623
|
// check path step key for spec violations
|
|
1624
|
-
const pathSegment = `${prefix}/${eltName}`;
|
|
1624
|
+
const pathSegment = `${ prefix }/${ eltName }`;
|
|
1625
1625
|
checkKeySpecViolations(elt, location, pathSegment);
|
|
1626
1626
|
}
|
|
1627
1627
|
delete elt.$visited;
|
|
@@ -1646,7 +1646,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1646
1646
|
let art = eltCsn._target || csnUtils.getCsnDef(eltCsn.target);
|
|
1647
1647
|
for (const ps of k.ref) {
|
|
1648
1648
|
art = art.elements[ps];
|
|
1649
|
-
pathSegment += `/${art.name}`;
|
|
1649
|
+
pathSegment += `/${ art.name }`;
|
|
1650
1650
|
checkKeySpecViolations(art, location, pathSegment);
|
|
1651
1651
|
if (art.type && !isBuiltinType(art.type))
|
|
1652
1652
|
art = art._type || csnUtils.getCsnDef(art.type);
|
|
@@ -1844,7 +1844,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1844
1844
|
// if own struct and target have a set they either are in the same $mySchemaName or not
|
|
1845
1845
|
// if target is in another schema, target the full qualified entity set
|
|
1846
1846
|
path = (elt._target.$mySchemaName === def.$mySchemaName)
|
|
1847
|
-
? [ baseName ] : [ `${elt._target.$mySchemaName}.EntityContainer`, baseName ];
|
|
1847
|
+
? [ baseName ] : [ `${ elt._target.$mySchemaName }.EntityContainer`, baseName ];
|
|
1848
1848
|
}
|
|
1849
1849
|
if (path) {
|
|
1850
1850
|
// if own struct and target have a set they either are in the same $mySchemaName or not
|
|
@@ -1875,7 +1875,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
npbs.forEach((p) => {
|
|
1878
|
-
p.Path = `${prefix}/${p.Path}`;
|
|
1878
|
+
p.Path = `${ prefix }/${ p.Path }`;
|
|
1879
1879
|
});
|
|
1880
1880
|
return npbs;
|
|
1881
1881
|
}
|
|
@@ -2299,7 +2299,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
2299
2299
|
eltPath = absPath.slice(2).join('/');
|
|
2300
2300
|
}
|
|
2301
2301
|
}
|
|
2302
|
-
const proxyDict = `$${scope}AnnoProxies`;
|
|
2302
|
+
const proxyDict = `$${ scope }AnnoProxies`;
|
|
2303
2303
|
|
|
2304
2304
|
xprANames.forEach((xprAName) => {
|
|
2305
2305
|
isSubTreeSpan = true;
|
|
@@ -2337,7 +2337,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
|
|
|
2337
2337
|
}
|
|
2338
2338
|
proxyCarrier[xprAName] = carrier[xprAName];
|
|
2339
2339
|
carrier[xprAName] = null;
|
|
2340
|
-
nxprANames.filter(an => an.startsWith(`${xprAName}.`)).forEach((nxprAName) => {
|
|
2340
|
+
nxprANames.filter(an => an.startsWith(`${ xprAName }.`)).forEach((nxprAName) => {
|
|
2341
2341
|
proxyCarrier[nxprAName] = carrier[nxprAName];
|
|
2342
2342
|
carrier[nxprAName] = null;
|
|
2343
2343
|
});
|
package/lib/edm/edmUtils.js
CHANGED
|
@@ -138,7 +138,7 @@ function resolveOnConditionAndPrepareConstraints( csn, assocCsn, messageFunction
|
|
|
138
138
|
// Partnership is ambiguous
|
|
139
139
|
setProp(originAssocCsn, '$noPartner', true);
|
|
140
140
|
info('odata-unexpected-comparison', [ 'definitions', parentName, 'elements', assocCsn.name ], {
|
|
141
|
-
name: `${originParentName}:${partnerPath.join('.')}`,
|
|
141
|
+
name: `${ originParentName }:${ partnerPath.join('.') }`,
|
|
142
142
|
target: originAssocCsn._target.name,
|
|
143
143
|
id: '$self',
|
|
144
144
|
alias: parentName,
|
|
@@ -168,12 +168,12 @@ function resolveOnConditionAndPrepareConstraints( csn, assocCsn, messageFunction
|
|
|
168
168
|
key id : Integer;
|
|
169
169
|
toMe: association to E on toMe.id = $self; };
|
|
170
170
|
*/
|
|
171
|
-
throw new CompilerAssertion(`Backlink association element is not an association or composition: "${originAssocCsn.name}`);
|
|
171
|
+
throw new CompilerAssertion(`Backlink association element is not an association or composition: "${ originAssocCsn.name }`);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
175
175
|
warning(null, [ 'definitions', parentName ],
|
|
176
|
-
{ partner: `${assocCsn._target.name}/${partnerPath}`, name: `${parentName}/${assocCsn.name}` },
|
|
176
|
+
{ partner: `${ assocCsn._target.name }/${ partnerPath }`, name: `${ parentName }/${ assocCsn.name }` },
|
|
177
177
|
'Can\'t resolve backlink to $(PARTNER) from $(NAME)');
|
|
178
178
|
}
|
|
179
179
|
});
|
|
@@ -476,7 +476,7 @@ function determineMultiplicity( csn ) {
|
|
|
476
476
|
function getEffectiveTargetCardinality( csn ) {
|
|
477
477
|
const rc = { min: 0, max: 1 };
|
|
478
478
|
if (!csn._constraints || !csn._constraints.$finalized)
|
|
479
|
-
throw new CompilerAssertion(`_constraints missing or not finalized: "${csn.name}`);
|
|
479
|
+
throw new CompilerAssertion(`_constraints missing or not finalized: "${ csn.name }`);
|
|
480
480
|
// partner (forward) cardinality has precedence
|
|
481
481
|
if (csn._constraints._partnerCsn) {
|
|
482
482
|
if (csn._constraints._partnerCsn.cardinality?.srcmin)
|
|
@@ -746,7 +746,7 @@ function escapeStringForText( str ) {
|
|
|
746
746
|
*/
|
|
747
747
|
function encodeNonCharacters( codePoint ) {
|
|
748
748
|
const hex = codePoint.toString(16).toUpperCase();
|
|
749
|
-
return `&#x${hex};`;
|
|
749
|
+
return `&#x${ hex };`;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
752
|
// return the path prefix of a given name or if no prefix available 'root'
|
|
@@ -778,9 +778,9 @@ function mergeIntoNavPropEntry( annoPrefix, navPropEntry, prefix, props ) {
|
|
|
778
778
|
let newEntry = false;
|
|
779
779
|
|
|
780
780
|
// Filter properties with prefix and reduce them into a new dictionary
|
|
781
|
-
const o = props.filter(p => p[0].startsWith(`${annoPrefix}.`)).reduce((a, c) => {
|
|
781
|
+
const o = props.filter(p => p[0].startsWith(`${ annoPrefix }.`)).reduce((a, c) => {
|
|
782
782
|
// clone the annotation value to avoid side effects with rewritten paths
|
|
783
|
-
a[c[0].replace(`${annoPrefix}.`, '')] = cloneAnnotationValue(c[1]);
|
|
783
|
+
a[c[0].replace(`${ annoPrefix }.`, '')] = cloneAnnotationValue(c[1]);
|
|
784
784
|
return a;
|
|
785
785
|
}, { });
|
|
786
786
|
|
|
@@ -877,7 +877,7 @@ function createSchemaRef( serviceRoots, targetSchemaName ) {
|
|
|
877
877
|
return ( // generate one from the service's name
|
|
878
878
|
last
|
|
879
879
|
.replace(/Service$/, '') // > CatalogService --> Catalog
|
|
880
|
-
.replace(/([a-z0-9])([A-Z])/g, (_, c, C) => `${c}-${C.toLowerCase()}`) // > ODataFooBarX9 --> odata-foo-bar-x9
|
|
880
|
+
.replace(/([a-z0-9])([A-Z])/g, (_, c, C) => `${ c }-${ C.toLowerCase() }`) // > ODataFooBarX9 --> odata-foo-bar-x9
|
|
881
881
|
.replace(/_/g, '-') // > foo_bar_baz --> foo-bar-baz
|
|
882
882
|
.toLowerCase() // > FOO --> foo
|
|
883
883
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
226c8854e08665b3eaae3ae1a1276db7
|