@saptools/service-flow 0.1.59 → 0.1.60

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.60
4
+
5
+ - Fixed RC-A by resolving remote `send({ query: ... })` entities from the original query initializer AST and its real lexical scope, removing the isolated text reparse that fabricated parameter, mutable-local, runtime-const, runtime-destructured, and shadowed entity names while preserving genuine static entities and top-level query aliases.
6
+ - Fixed RC-B by assigning the existing query warning to query-present remote calls whose entity stays dynamic, matching local query diagnostics without changing the `remote_query` call type, confidence, schema, linker, trace, or output shape and completing the remote identifier-reparsing follow-up documented in 0.1.59.
7
+
3
8
  ## 0.1.59
4
9
 
5
10
  - Fixed RC-A by making local DB query entities lexical-binding-aware: parameters, simple mutable locals, runtime const aliases, destructuring from runtime or reassigned sources, and direct `this.<field>` targets now remain dynamic at the existing low-confidence warning path instead of becoming fabricated entities.
@@ -3676,18 +3676,6 @@ function queryRunEvidence(source, argument) {
3676
3676
  } : {}
3677
3677
  };
3678
3678
  }
3679
- function extractQueryEntity(expr) {
3680
- const source = ts10.createSourceFile("query.ts", `const __query = (${expr});`, ts10.ScriptTarget.Latest, true, ts10.ScriptKind.TS);
3681
- const initializers = variableInitializers(source);
3682
- let found;
3683
- const visit = (node) => {
3684
- if (found) return;
3685
- if (ts10.isParenthesizedExpression(node)) found = queryEntityFromAst(node.expression, initializers);
3686
- ts10.forEachChild(node, visit);
3687
- };
3688
- visit(source);
3689
- return found;
3690
- }
3691
3679
  function queryWarning(expr) {
3692
3680
  if (/^\s*[`'"]/.test(expr)) return "raw_sql_or_cql_expression";
3693
3681
  if (/^\s*\w+\s*$/.test(expr)) return "query_variable_without_static_initializer";
@@ -3991,7 +3979,7 @@ function classifyOutboundCallsInSource(source, filePath) {
3991
3979
  const objectArg = node.arguments[0];
3992
3980
  if (objectArg && ts10.isObjectLiteralExpression(objectArg)) {
3993
3981
  const receiver = receiverName(expr.expression);
3994
- const query = objectPropertyText(objectArg, "query");
3982
+ const queryExpression = propertyInitializer(objectArg, "query");
3995
3983
  const method = stripQuotes(resolveExpression(propertyInitializer(objectArg, "method"), node, "literal").value ?? objectPropertyText(objectArg, "method") ?? "POST");
3996
3984
  const pathExpr = propertyInitializer(objectArg, "path") ?? propertyInitializer(objectArg, "event");
3997
3985
  const pathAnalysis = analyzeOperationPath(pathExpr, node, method);
@@ -4002,8 +3990,9 @@ function classifyOutboundCallsInSource(source, filePath) {
4002
3990
  const entityCallTypes = { entity_mutation: "remote_entity_mutation", entity_delete: "remote_entity_delete", entity_media: "remote_entity_media", entity_candidate: "remote_entity_candidate" };
4003
3991
  const entityCallType = entityCallTypes[intent.kind];
4004
3992
  const isODataQueryRead = method.toUpperCase() === "GET" && ["entity_query", "entity_key_read", "entity_navigation_query"].includes(intent.kind);
4005
- const unresolvedReason = !query && pathExpr ? pathUnresolvedReason(pathAnalysis) : void 0;
4006
- add(node, { callType: query ? "remote_query" : entityCallType ?? (isODataQueryRead ? "remote_query" : "remote_action"), serviceVariableName: receiver, method, operationPathExpr, queryEntity: query ? extractQueryEntity(query) : isODataQueryRead ? intent.entitySegment : void 0, payloadSummary: summarizeExpression(objectArg.getText(source)), confidence: op || query ? 0.8 : 0.4, unresolvedReason }, { receiver, classifier: "service_client_send_object", operationPathExpression: shorthandPath ? op : void 0, rawPathExpression: pathAnalysis.rawExpression, literalPathSource: literalPathSource(pathAnalysis), odataPathIntent: operationPathExpr ? intent : void 0, pathAnalysis, staticPathCandidates: legacyPathCandidates(pathAnalysis), parserWarning: unresolvedReason });
3993
+ const queryEntity = queryExpression ? queryEntityFromAst(queryExpression, initializers) : isODataQueryRead ? intent.entitySegment : void 0;
3994
+ const unresolvedReason = queryExpression ? queryEntity ? void 0 : queryWarning(queryExpression.getText(source)) : pathExpr ? pathUnresolvedReason(pathAnalysis) : void 0;
3995
+ add(node, { callType: queryExpression ? "remote_query" : entityCallType ?? (isODataQueryRead ? "remote_query" : "remote_action"), serviceVariableName: receiver, method, operationPathExpr, queryEntity, payloadSummary: summarizeExpression(objectArg.getText(source)), confidence: op || queryExpression ? 0.8 : 0.4, unresolvedReason }, { receiver, classifier: "service_client_send_object", operationPathExpression: shorthandPath ? op : void 0, rawPathExpression: pathAnalysis.rawExpression, literalPathSource: literalPathSource(pathAnalysis), odataPathIntent: operationPathExpr ? intent : void 0, pathAnalysis, staticPathCandidates: legacyPathCandidates(pathAnalysis), parserWarning: unresolvedReason });
4007
3996
  } else {
4008
3997
  const receiver = receiverName(expr.expression);
4009
3998
  const rootReceiver = rootReceiverName(expr.expression);
@@ -8970,4 +8959,4 @@ export {
8970
8959
  selectorRepoAmbiguousDiagnostic,
8971
8960
  trace
8972
8961
  };
8973
- //# sourceMappingURL=chunk-GLZSDBRG.js.map
8962
+ //# sourceMappingURL=chunk-BGD7UYJN.js.map