@saptools/service-flow 0.1.55 → 0.1.57
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 +11 -0
- package/README.md +8 -5
- package/TECHNICAL-NOTE.md +6 -0
- package/dist/{chunk-GXYVIHJ5.js → chunk-DCOFNDKS.js} +386 -183
- package/dist/chunk-DCOFNDKS.js.map +1 -0
- package/dist/cli.js +14 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/db/repositories.ts +77 -22
- package/src/parsers/000-direct-query-execution.ts +287 -0
- package/src/parsers/outbound-call-parser.ts +10 -73
- package/src/parsers/symbol-parser.ts +12 -6
- package/dist/chunk-GXYVIHJ5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.57
|
|
4
|
+
|
|
5
|
+
- Made local executable symbol-call resolution import-binding-aware: relative helper shadowing now bypasses same-file methods (RC1), namespace members resolve within their imported module (RC2), duplicate exports use fail-closed path disambiguation while barrels remain ambiguous (RC3), and singleton-accessor chains reach non-exported instance methods in the imported class module (RC4).
|
|
6
|
+
- Recorded non-relative package-import calls with `package_import` evidence instead of silently dropping them (RC5 minimal-safe); they remain deterministically unresolved until a post-publication workspace pass can resolve sibling-package symbols without index-order or stale-ID risk.
|
|
7
|
+
- Persisted bounded module-path and candidate-strategy evidence without a schema migration or trace/rendering shape change, with neutral parser, SQLite, trace-edge, and repeated force-index/relink coverage.
|
|
8
|
+
|
|
9
|
+
## 0.1.56
|
|
10
|
+
|
|
11
|
+
- Completed direct CAP query-builder execution-context indexing for builders returned by async or syntactically guaranteed-Promise callables and for static builder elements in awaited `Promise.all(...)`, while retaining one fact per logical statement and the existing conservative unknown-entity behavior.
|
|
12
|
+
- Recorded stable direct execution-context evidence (`await`, `async_return`, `promise_return`, or `promise_aggregate`) without changing the SQLite schema, graph edge type, trace filters, or wrapper ownership.
|
|
13
|
+
|
|
3
14
|
## 0.1.55
|
|
4
15
|
|
|
5
16
|
- Indexed directly awaited CAP query-builder statements as local database calls, preserving exact builder-root evidence, fluent statement offsets, dynamic-entity warnings, method ownership, and the existing single `cds.run(...)` fact.
|
package/README.md
CHANGED
|
@@ -174,7 +174,7 @@ Local CAP calls through `cds.services.<Service>.<operation>()`, bracket service
|
|
|
174
174
|
|
|
175
175
|
Conservative local symbol traversal intentionally excludes decorators, built-ins such as `JSON.parse`, collection methods, third-party APIs, and arbitrary property chains unless the callee can plausibly resolve to an indexed local symbol. Named export lists such as `export { loadTemplate as publicLoadTemplate }` are indexed with the public exported name so relative imports can resolve. One-level object-literal helpers are indexed as symbols named like `cacheHelper.getConfiguration`; nested object literals are not yet expanded beyond the first helper level. `parseGeneratedConstants` remains a public low-level parser export for callers that need it, but generated constants are not persisted as graph facts in this patch; linking uses the deterministic decorator normalizer described above.
|
|
176
176
|
JSON output includes typed nodes for calls, operations, database entities,
|
|
177
|
-
external destinations, and unresolved/dynamic candidates when edges exist. Chained CAP DB queries inside `cds.run(...)` and
|
|
177
|
+
external destinations, and unresolved/dynamic candidates when edges exist. Chained CAP DB queries inside `cds.run(...)` and direct supported builders are parsed with TypeScript AST evidence for `SELECT`, `INSERT`, `UPSERT`, `UPDATE`, and `DELETE` forms. A direct builder needs both a recognized CAP root and a proven execution context: direct `await`, return from an `async` or syntactically guaranteed-Promise callable, or a static element of awaited `Promise.all([...])`. Plain query factories and unrelated methods named `from`, `where`, or `set` are not promoted to database facts. When the query target is genuinely dynamic, graph status remains terminal and JSON retains `parserWarning` evidence, while table and Mermaid render the target as `Entity: unknown` rather than a numeric call id.
|
|
178
178
|
|
|
179
179
|
```bash
|
|
180
180
|
service-flow trace --workspace /path/to/workspace --repo facade-service --operation doWork
|
|
@@ -274,10 +274,13 @@ External HTTP facts use semantic terminal nodes instead of outbound-call row ids
|
|
|
274
274
|
a concrete client. Trace evidence includes the caller variable, returned
|
|
275
275
|
property, imported helper, source file, exported symbol, placeholders, and
|
|
276
276
|
transaction alias steps.
|
|
277
|
-
- Direct
|
|
277
|
+
- Direct `SELECT.one.from(Entity)`, `SELECT.from(Entity)`,
|
|
278
278
|
`INSERT.into(Entity)`, `UPSERT.into(Entity)`, `UPDATE(Entity)`, and
|
|
279
|
-
`DELETE.from(Entity)` statements
|
|
280
|
-
|
|
279
|
+
`DELETE.from(Entity)` statements are indexed when directly awaited, returned
|
|
280
|
+
by an `async` or guaranteed-Promise callable, or supplied as static elements
|
|
281
|
+
to awaited `Promise.all([...])`; equivalent `cds.run(...)` queries retain
|
|
282
|
+
their wrapper classification. Plain non-promise query factories stay out of
|
|
283
|
+
local database facts.
|
|
281
284
|
- `doctor` reports silent quality problems such as services without operations,
|
|
282
285
|
handler repositories without CDS service facts, and an empty search index.
|
|
283
286
|
|
|
@@ -341,7 +344,7 @@ service-flow clean --workspace /path/to/workspace
|
|
|
341
344
|
| Handler facts | `cds-routing-handlers` decorators, handler classes/methods, server registrations |
|
|
342
345
|
| Service bindings | `cds.connect.to("alias")`, aliases from `package.json#cds.requires`, destination/service path expressions |
|
|
343
346
|
| Outbound calls | `remote.send({ method, path })`, `remote.send({ query })`, `cds.services.Service.operation()`, service wrapper calls |
|
|
344
|
-
| Local data access |
|
|
347
|
+
| Local data access | directly executed CAP query builders, `cds.run(SELECT...)`, and local entity query evidence |
|
|
345
348
|
| Async channels | Event Mesh-style `emit`, `publish`, and `on` facts |
|
|
346
349
|
| External calls | Cloud SDK-style HTTP/destination calls and external edge evidence |
|
|
347
350
|
| Generated constants | low-level `parseGeneratedConstants` parser output for integrations; not persisted as first-class graph facts in this patch |
|
package/TECHNICAL-NOTE.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Service Flow Resolution Notes
|
|
2
2
|
|
|
3
|
+
## 0.1.56 direct query execution-context notes
|
|
4
|
+
|
|
5
|
+
- A structural direct CAP builder root now produces one `local_db_query` fact in four proven contexts: direct `await`, a return from the nearest `async` callable, a return from a callable with an AST-guaranteed `Promise` or `PromiseLike` contract, and a static direct element of awaited `Promise.all([...])`. Evidence adds `queryExecutionContext` as `await`, `async_return`, `promise_return`, or `promise_aggregate`, while retaining the existing direct dispatch and bounded source offsets.
|
|
6
|
+
- Promise contracts accept direct, `globalThis`/`global` qualified, parenthesized, all-promise union, and promise-containing intersection forms. Plain returns, unresolved aliases, non-guaranteed unions, and async generators remain unindexed so a query factory is not mistaken for execution. Aggregate detection is limited to an awaited, unshadowed `Promise.all` array; arbitrary consumers and other aggregate methods are not promoted.
|
|
7
|
+
- The parser still emits one fact for one logical statement. Direct builders nested in `cds.run(...)`, known service-client query payloads, or an already awaited aggregate element retain their established single owner/classifier. No schema or linker change is needed: normal source-symbol ownership, `HANDLER_RUNS_DB_QUERY` edges, and `--include-db` rendering consume these facts unchanged.
|
|
8
|
+
|
|
3
9
|
## 0.1.55 direct query-builder and stdout notes
|
|
4
10
|
|
|
5
11
|
- Direct, awaited CAP builders now create one `local_db_query` fact when their AST root is a supported `SELECT`, `INSERT`, `UPSERT`, `UPDATE`, or `DELETE` form. The parser follows fluent continuations and transparent TypeScript wrappers, records the direct dispatch marker plus root and statement offsets, and keeps ordinary member-name lookalikes out of database facts. A builder nested in `cds.run(...)` remains one wrapper-dispatched fact.
|