New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sap-ux/annotation-converter

Package Overview
Dependencies
Maintainers
3
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/annotation-converter - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

6

CHANGELOG.md
# @sap-ux/annotation-converter
## 0.6.4
### Patch Changes
- 7230a33: feat: allow to resolve entity type by their fqdn
## 0.6.3

@@ -4,0 +10,0 @@

30

dist/converter.js

@@ -32,3 +32,3 @@ "use strict";

function resolveTarget(converter, startElement, path, annotationsTerm) {
var _a;
var _a, _b, _c, _d;
// absolute paths always start at the entity container

@@ -54,3 +54,12 @@ if (path.startsWith('/')) {

// no starting point given: start at the entity container
startElement = converter.getConvertedEntityContainer();
if (pathSegments[0].startsWith(converter.rawSchema.namespace) &&
pathSegments[0] !== ((_a = converter.getConvertedEntityContainer()) === null || _a === void 0 ? void 0 : _a.fullyQualifiedName)) {
// We have a fully qualified name in the path that is not the entity container.
startElement =
(_c = (_b = converter.getConvertedEntityType(pathSegments[0])) !== null && _b !== void 0 ? _b : converter.getConvertedComplexType(pathSegments[0])) !== null && _c !== void 0 ? _c : converter.getConvertedAction(pathSegments[0]);
pathSegments.shift(); // Let's remove the first path element
}
else {
startElement = converter.getConvertedEntityContainer();
}
}

@@ -65,3 +74,3 @@ else if (startElement[ANNOTATION_TARGET] !== undefined) {

startElement =
(_a = converter.getConvertedEntityType(parentElementFQN)) !== null && _a !== void 0 ? _a : converter.getConvertedComplexType(parentElementFQN);
(_d = converter.getConvertedEntityType(parentElementFQN)) !== null && _d !== void 0 ? _d : converter.getConvertedComplexType(parentElementFQN);
}

@@ -112,2 +121,5 @@ const result = pathSegments.reduce((current, segment) => {

switch ((_b = current.target) === null || _b === void 0 ? void 0 : _b._type) {
case 'Schema':
// next element: EntityType, ComplexType, Action, EntityContainer ?
break;
case 'EntityContainer':

@@ -545,9 +557,15 @@ {

return collectionDefinition.map((navPropertyPath, navPropIdx) => {
var _a;
const navigationPropertyPath = (_a = navPropertyPath.NavigationPropertyPath) !== null && _a !== void 0 ? _a : '';
const result = {
type: 'NavigationPropertyPath',
value: navPropertyPath.NavigationPropertyPath,
value: navigationPropertyPath,
fullyQualifiedName: `${parentFQN}/${navPropIdx}`
};
(0, utils_1.lazy)(result, '$target', () => resolveTarget(converter, currentTarget, navPropertyPath.NavigationPropertyPath, currentTerm)
.target);
if (navigationPropertyPath === '') {
result.$target = undefined;
}
else {
(0, utils_1.lazy)(result, '$target', () => resolveTarget(converter, currentTarget, navigationPropertyPath, currentTerm).target);
}
return result;

@@ -554,0 +572,0 @@ });

4

package.json
{
"name": "@sap-ux/annotation-converter",
"version": "0.6.3",
"version": "0.6.4",
"description": "SAP Fiori OData - Annotation converter",

@@ -17,3 +17,3 @@ "repository": {

"devDependencies": {
"@sap-ux/vocabularies-types": "0.7.0",
"@sap-ux/vocabularies-types": "0.7.2",
"@sap-ux/edmx-parser": "0.5.13"

@@ -20,0 +20,0 @@ },

@@ -111,3 +111,15 @@ import type {

// no starting point given: start at the entity container
startElement = converter.getConvertedEntityContainer();
if (
pathSegments[0].startsWith(converter.rawSchema.namespace) &&
pathSegments[0] !== converter.getConvertedEntityContainer()?.fullyQualifiedName
) {
// We have a fully qualified name in the path that is not the entity container.
startElement =
converter.getConvertedEntityType(pathSegments[0]) ??
converter.getConvertedComplexType(pathSegments[0]) ??
converter.getConvertedAction(pathSegments[0]);
pathSegments.shift(); // Let's remove the first path element
} else {
startElement = converter.getConvertedEntityContainer();
}
} else if (startElement[ANNOTATION_TARGET] !== undefined) {

@@ -178,2 +190,6 @@ // annotation: start at the annotation target

switch (current.target?._type) {
case 'Schema':
// next element: EntityType, ComplexType, Action, EntityContainer ?
break;
case 'EntityContainer':

@@ -770,15 +786,18 @@ {

return collectionDefinition.map((navPropertyPath, navPropIdx) => {
const navigationPropertyPath = navPropertyPath.NavigationPropertyPath ?? '';
const result = {
type: 'NavigationPropertyPath',
value: navPropertyPath.NavigationPropertyPath,
value: navigationPropertyPath,
fullyQualifiedName: `${parentFQN}/${navPropIdx}`
} as any;
lazy(
result,
'$target',
() =>
resolveTarget(converter, currentTarget, navPropertyPath.NavigationPropertyPath, currentTerm)
.target
);
if (navigationPropertyPath === '') {
result.$target = undefined;
} else {
lazy(
result,
'$target',
() => resolveTarget(converter, currentTarget, navigationPropertyPath, currentTerm).target
);
}

@@ -785,0 +804,0 @@ return result;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc