@saptools/service-flow 0.1.2 โ 0.1.4
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 +17 -0
- package/README.md +16 -7
- package/TECHNICAL-NOTE.md +14 -0
- package/dist/chunk-JY6GBGZT.js +1313 -0
- package/dist/chunk-JY6GBGZT.js.map +1 -0
- package/dist/cli.js +78 -33
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-6U4QKQEL.js +0 -742
- package/dist/chunk-6U4QKQEL.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
- Resolved helper-returned service bindings exported through named export lists, including aliased exports, while preserving helper-chain evidence.
|
|
6
|
+
- Parsed `cds.connect.to(alias, options)` as separate alias, destination, and service-path evidence so dynamic service paths can resolve with runtime variables.
|
|
7
|
+
- Improved repository discovery so valid workspace-root Git repositories no longer prevent nested repository discovery, and empty `.git` markers are ignored.
|
|
8
|
+
- Added explicit SQLite foreign-key constraints for fresh databases and recorded alias-expression evidence for service bindings.
|
|
9
|
+
- Documented clearer operator guidance for test-file hygiene, doctor severity, and list/trace selector semantics.
|
|
10
|
+
|
|
11
|
+
## 0.1.3
|
|
12
|
+
|
|
13
|
+
- Propagated imported helper-returned `cds.connect.to(...)` bindings to caller-local service variables with helper-chain evidence.
|
|
14
|
+
- Changed operation resolution to prefer ambiguous/dynamic/unresolved graph edges over confident operation-path-only links.
|
|
15
|
+
- Improved chained CAP query entity extraction and table/JSON source-location evidence.
|
|
16
|
+
- Hardened trace traversal with repo-aware downstream scopes, stable visited keys, edge de-duplication, and cycle markers.
|
|
17
|
+
- Added safer clean behavior that only recursively removes marker-owned state directories.
|
|
18
|
+
- Added `doctor --strict` to separate entity-only service noise from action-oriented default diagnostics.
|
|
19
|
+
|
|
3
20
|
## 0.1.2
|
|
4
21
|
|
|
5
22
|
- Hardened SQLite CLI access with busy timeouts, retries, and larger read buffers for large graph/link runs.
|
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ Index independent Git repositories, persist CAP/CDS facts in SQLite, resolve cro
|
|
|
27
27
|
- ๐ง **Dynamic edge support** โ preserves parameterized destinations and service paths such as `svc_${objectCode}_process`, then lets traces apply runtime `--var key=value` values
|
|
28
28
|
- ๐ **Multiple output modes** โ renders human-readable tables, JSON for automation, and Mermaid diagrams for architecture docs
|
|
29
29
|
- ๐ฉบ **Diagnostics-first workflow** โ records parse/index issues and exposes them through `service-flow doctor` instead of hiding partial analysis
|
|
30
|
+
- ๐งฉ **CAP helper-aware binding evidence** โ follows imported helpers exported directly or through named export lists and separates alias, destination, and service-path expressions for dynamic `cds.connect.to(alias, options)` calls
|
|
31
|
+
- ๐งญ **Nested workspace discovery** โ scans nested repositories even when the selected root is itself a valid Git repository, while ignoring empty `.git` placeholders
|
|
30
32
|
- ๐ **Secret-aware summaries** โ redacts sensitive keys in persisted summaries and CLI output while keeping useful source evidence
|
|
31
33
|
- ๐ฆ **Standalone CLI & typed package** โ ships as an npm CLI with TypeScript definitions for integration into other saptools workflows
|
|
32
34
|
|
|
@@ -107,7 +109,6 @@ service-flow index --workspace /path/to/workspace --repo identity-service --forc
|
|
|
107
109
|
| `--workspace <path>` | Workspace root or a path that can load the saved workspace configuration |
|
|
108
110
|
| `--repo <name>` | Index only one repository by discovered repository name |
|
|
109
111
|
| `--force` | Re-index even when file hashes indicate nothing changed |
|
|
110
|
-
| `--concurrency <n>` | Reserved for future parallel indexing; currently defaults to `1` |
|
|
111
112
|
|
|
112
113
|
### ๐ `service-flow link`
|
|
113
114
|
|
|
@@ -134,7 +135,8 @@ external destinations, and unresolved/dynamic candidates when edges exist.
|
|
|
134
135
|
```bash
|
|
135
136
|
service-flow trace --workspace /path/to/workspace --repo facade-service --operation doWork
|
|
136
137
|
service-flow trace --workspace /path/to/workspace --service /FacadeService --path /doWork --format json
|
|
137
|
-
service-flow trace --workspace /path/to/workspace --handler EntryHandler --
|
|
138
|
+
service-flow trace --workspace /path/to/workspace --handler EntryHandler --depth 1 --format json
|
|
139
|
+
service-flow trace --workspace /path/to/workspace --service /FacadeService --path /doWork --depth 2
|
|
138
140
|
service-flow trace --workspace /path/to/workspace --repo facade-service --operation doWork --var objectCode=xx --var objectType=Thing
|
|
139
141
|
```
|
|
140
142
|
|
|
@@ -180,6 +182,7 @@ service-flow list repos --workspace /path/to/workspace
|
|
|
180
182
|
service-flow list services --workspace /path/to/workspace --repo facade-service
|
|
181
183
|
service-flow list operations --workspace /path/to/workspace --repo facade-service --service /FacadeService
|
|
182
184
|
service-flow list calls --workspace /path/to/workspace --repo facade-service --operation doWork
|
|
185
|
+
# `--operation` filters outgoing call paths/payloads; use trace/graph `--operation` for handler-origin traversal.
|
|
183
186
|
```
|
|
184
187
|
|
|
185
188
|
| Command | Description |
|
|
@@ -193,11 +196,11 @@ service-flow list calls --workspace /path/to/workspace --repo facade-service --o
|
|
|
193
196
|
|
|
194
197
|
- If a remote edge is unresolved, run `service-flow list calls --operation <name>`
|
|
195
198
|
and `service-flow inspect operation <name>` to compare the captured call path
|
|
196
|
-
with indexed CDS operations.
|
|
199
|
+
with indexed CDS operations. Operation-path-only matches are shown as ambiguous/unresolved with candidate counts instead of high-confidence cross-repo links.
|
|
197
200
|
- Service bindings are matched to outbound calls by repository, source file, and
|
|
198
201
|
variable name to avoid false cross-file matches. If a helper-returned client is
|
|
199
|
-
not linked,
|
|
200
|
-
`cds.connect.to(...)` directly.
|
|
202
|
+
not linked, export the helper from a relative import target and ensure it returns
|
|
203
|
+
`cds.connect.to(...)` directly or through a simple wrapper. Trace evidence includes the caller variable, imported helper, source file, and exported symbol.
|
|
201
204
|
- `SELECT.one.from(Entity)`, `SELECT.from(Entity)`, `INSERT.into(Entity)`,
|
|
202
205
|
`UPDATE(Entity)`, and `DELETE.from(Entity)` are indexed as local database
|
|
203
206
|
query entities when statically knowable.
|
|
@@ -221,10 +224,11 @@ service-flow inspect operation /doWork --workspace /path/to/workspace
|
|
|
221
224
|
|
|
222
225
|
### ๐ฉบ `service-flow doctor`
|
|
223
226
|
|
|
224
|
-
Print stored diagnostics. A clean workspace prints `No diagnostics recorded`.
|
|
227
|
+
Print stored diagnostics. Default output suppresses high-noise entity-only service checks; `--strict` includes them. A clean workspace prints `No diagnostics recorded`.
|
|
225
228
|
|
|
226
229
|
```bash
|
|
227
230
|
service-flow doctor --workspace /path/to/workspace
|
|
231
|
+
service-flow doctor --workspace /path/to/workspace --strict
|
|
228
232
|
```
|
|
229
233
|
|
|
230
234
|
### ๐งน `service-flow clean`
|
|
@@ -239,7 +243,7 @@ service-flow clean --workspace /path/to/workspace
|
|
|
239
243
|
| Flag | Description |
|
|
240
244
|
| --- | --- |
|
|
241
245
|
| `--db-only` | Remove only the configured SQLite database |
|
|
242
|
-
| *(default)* | Remove the
|
|
246
|
+
| *(default)* | Remove the marker-owned `.service-flow` state directory; custom/unowned or dangerous parent directories are refused |
|
|
243
247
|
|
|
244
248
|
---
|
|
245
249
|
|
|
@@ -279,6 +283,10 @@ service-flow trace --workspace /path/to/workspace --repo facade-service --operat
|
|
|
279
283
|
|
|
280
284
|
When a concrete target exists after variable substitution, the trace shows both the parameterized evidence and the resolved match. When it does not, `service-flow` keeps the edge as a dynamic candidate or unresolved edge so the missing link remains visible.
|
|
281
285
|
|
|
286
|
+
Service-binding evidence keeps these fields distinct: service alias, alias expression, destination expression, service-path expression, operation-path expression, and runtime placeholders. This is important for common CAP helpers such as `cds.connect.to(`remote_${code}`, { credentials: { destination: `remote_${code}`, path: `/${entityType}ProcessService` } })`, where the alias is not the service path.
|
|
287
|
+
|
|
288
|
+
By default, production traces should be built from production source files. Keep generated credentials and local state out of git, and use explicit fixture/test workspaces when validating test-only mocked service clients so they do not pollute production graph interpretation.
|
|
289
|
+
|
|
282
290
|
---
|
|
283
291
|
|
|
284
292
|
## ๐ Workspace State
|
|
@@ -376,6 +384,7 @@ Run `service-flow index` after source, CDS, package metadata, or helper-package
|
|
|
376
384
|
<summary><b>Why is an expected call unresolved?</b></summary>
|
|
377
385
|
|
|
378
386
|
Check `service-flow doctor`, then inspect the facts with `service-flow list services`, `service-flow list operations`, and `service-flow list calls`. Dynamic destinations may need `--var key=value`, and custom wrappers may need new parser support.
|
|
387
|
+
Default doctor output is intended to focus on actionable indexing or trace-impacting issues; use `--strict` when you need exhaustive model-shape diagnostics for entity-only or extension-heavy CDS models.
|
|
379
388
|
|
|
380
389
|
</details>
|
|
381
390
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Service Flow 0.1.4 Resolution Notes
|
|
2
|
+
|
|
3
|
+
- Imported helper bindings: TypeScript imports are resolved for relative modules. When a caller assigns `const client = await connectToService()`, the analyzer follows the imported symbol to an exported helper that returns `cds.connect.to(...)` and persists caller-variable evidence plus the helper source/export chain.
|
|
4
|
+
- Candidate ranking: operation-path matches start as weak candidates. A resolved operation edge requires a strong signal such as exact service path, CDS alias/destination context, or explicit dynamic variable overrides. Otherwise candidates are preserved in edge evidence as ambiguous or unresolved.
|
|
5
|
+
- Edge states: `REMOTE_CALL_RESOLVES_TO_OPERATION` is used only above the resolution threshold; `DYNAMIC_EDGE_CANDIDATE` preserves runtime-dependent service paths/destinations; `UNRESOLVED_EDGE` carries candidate counts and reasons when static evidence is insufficient.
|
|
6
|
+
- Trace cycle safety: trace queues carry repository IDs, visited scope keys are independent of depth, graph edge IDs are emitted once, and revisiting an already-seen downstream operation scope creates a cycle marker instead of recursive expansion.
|
|
7
|
+
- SQLite reliability: the package uses WAL, foreign keys, busy timeouts, and retries around the SQLite adapter. Statement failures throw before output rendering so commands do not report successful JSON/table/Mermaid results after an internal database failure.
|
|
8
|
+
|
|
9
|
+
## 0.1.4 trace-correctness additions
|
|
10
|
+
|
|
11
|
+
- Helper exports are normalized through a public-to-local export map, so `export { helper }` and `export { helper as publicHelper }` both resolve to the local declaration that contains the `cds.connect.to(...)` call.
|
|
12
|
+
- Two-argument CAP connections keep alias expressions distinct from `credentials.destination` and `credentials.path` / `credentials.servicePath`; dynamic placeholders from all three fields are retained for later `--var` substitution.
|
|
13
|
+
- Repository discovery validates `.git` markers using `HEAD`, `config`, or gitfile `gitdir:` content and keeps scanning children so outer workspaces can contain many nested repositories.
|
|
14
|
+
- Fresh SQLite stores now declare core parent/child foreign keys with cascading cleanup for repository-owned facts.
|