@living-architecture/riviere-extract-ts 0.4.6 → 0.4.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"http-call-link-rewrite.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/connection-detection/http-call-link-rewrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIrD,iCAAiC;AACjC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B;AA+ED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,UAAU,EAAE,SAAS,iBAAiB,EAAE,GACvC,qBAAqB,CA2CvB;AAED,mCAAmC;AACnC,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,iBAAiB,EAAE,GACvC,iBAAiB,EAAE,CAErB"}
1
+ {"version":3,"file":"http-call-link-rewrite.d.ts","sourceRoot":"","sources":["../../../../../src/features/extraction/domain/connection-detection/http-call-link-rewrite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIrD,iCAAiC;AACjC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B;AAsGD,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,UAAU,EAAE,SAAS,iBAAiB,EAAE,GACvC,qBAAqB,CA0DvB;AAED,mCAAmC;AACnC,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,iBAAiB,EAAE,GACvC,iBAAiB,EAAE,CAErB"}
@@ -22,6 +22,18 @@ function mapInternalComponentsByName(components) {
22
22
  }
23
23
  return byName;
24
24
  }
25
+ function findUniqueApiComponentInDomainMatchingRoute(components, domainName, route) {
26
+ if (route === undefined) {
27
+ return undefined;
28
+ }
29
+ const matchedApiComponents = components.filter((component) => component.type === 'api' &&
30
+ component.domain === domainName &&
31
+ component.metadata['route'] === route);
32
+ if (matchedApiComponents.length !== 1) {
33
+ return undefined;
34
+ }
35
+ return matchedApiComponents[0];
36
+ }
25
37
  function parseServiceName(httpCallComponent) {
26
38
  const rawServiceName = httpCallComponent.metadata['serviceName'];
27
39
  if (typeof rawServiceName === 'string' && rawServiceName.trim().length > 0) {
@@ -92,6 +104,14 @@ export function rewriteHttpCallLinks(links, components) {
92
104
  continue;
93
105
  }
94
106
  const route = parseRoute(targetComponent);
107
+ const uniqueApiTargetInDomain = findUniqueApiComponentInDomainMatchingRoute(components, serviceName, route);
108
+ if (uniqueApiTargetInDomain !== undefined) {
109
+ linksToKeep.push({
110
+ ...link,
111
+ target: componentIdentity(uniqueApiTargetInDomain),
112
+ });
113
+ continue;
114
+ }
95
115
  externalLinks.push(toExternalLink(link, serviceName, route));
96
116
  }
97
117
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@living-architecture/riviere-extract-ts",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "minimatch": "^10.0.1",
26
26
  "ts-morph": "^24.0.0",
27
- "@living-architecture/riviere-extract-config": "0.5.6",
28
- "@living-architecture/riviere-schema": "0.6.6"
27
+ "@living-architecture/riviere-schema": "0.6.6",
28
+ "@living-architecture/riviere-extract-config": "0.5.6"
29
29
  }
30
30
  }