@descryy/adapter-java 0.4.1 → 0.5.1
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/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +76 -9
- package/dist/adapter.js.map +1 -1
- package/dist/client-base.d.ts +114 -0
- package/dist/client-base.d.ts.map +1 -0
- package/dist/client-base.js +102 -0
- package/dist/client-base.js.map +1 -0
- package/dist/client.d.ts +48 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +87 -4
- package/dist/client.js.map +1 -1
- package/dist/dto.d.ts +86 -0
- package/dist/dto.d.ts.map +1 -0
- package/dist/dto.js +198 -0
- package/dist/dto.js.map +1 -0
- package/dist/external.d.ts +169 -0
- package/dist/external.d.ts.map +1 -0
- package/dist/external.js +262 -0
- package/dist/external.js.map +1 -0
- package/dist/extract.d.ts +29 -0
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +508 -8
- package/dist/extract.js.map +1 -1
- package/dist/jackson.d.ts +46 -0
- package/dist/jackson.d.ts.map +1 -0
- package/dist/jackson.js +73 -0
- package/dist/jackson.js.map +1 -0
- package/dist/parse.d.ts +44 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +154 -6
- package/dist/parse.js.map +1 -1
- package/dist/shape-reach.d.ts +27 -8
- package/dist/shape-reach.d.ts.map +1 -1
- package/dist/shape-reach.js +40 -9
- package/dist/shape-reach.js.map +1 -1
- package/package.json +7 -7
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,EAMrB,MAAM,aAAa,CAAC;AAErB,OAAO,EAA2C,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAIxH,OAAO,EAAyD,QAAQ,EAAmB,MAAM,cAAc,CAAC;AAKhH,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC;;;;;;kCAMkC;AAClC,eAAO,MAAM,eAAe,EAAE,MAErB,CAAC;AACV,eAAO,MAAM,kBAAkB,wBAAyB,CAAC;AAsCzD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC1C;AAcD,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAkU/E;AAED,2DAA2D;AAC3D,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAW7D;AAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/adapter.js
CHANGED
|
@@ -12,12 +12,13 @@ import { createHash } from "node:crypto";
|
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import { existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import { join } from "node:path";
|
|
15
|
-
import { CLIENT_CALL_EXTRACTOR, ORM_EXTRACTOR, ROUTE_EXTRACTOR, ROUTE_HANDLER_EXTRACTOR, } from "@descryy/ir";
|
|
16
|
-
import { discover, isolateFile, toRepoRelative } from "@descryy/adapter-common";
|
|
15
|
+
import { CLIENT_BASE_EXTRACTOR, CLIENT_CALL_EXTRACTOR, ORM_EXTRACTOR, ROUTE_EXTRACTOR, ROUTE_HANDLER_EXTRACTOR, } from "@descryy/ir";
|
|
16
|
+
import { discover, extractOrDegrade, isolateFile, toRepoRelative } from "@descryy/adapter-common";
|
|
17
17
|
import { parserFor, parseText } from "@descryy/adapter-treesitter";
|
|
18
18
|
import { readUnit } from "./parse.js";
|
|
19
|
-
import { extract, readEntities, DEFAULT_PACKAGE, LANGUAGE } from "./extract.js";
|
|
20
|
-
import {
|
|
19
|
+
import { degradedGraph, extract, readEntities, DEFAULT_PACKAGE, LANGUAGE } from "./extract.js";
|
|
20
|
+
import { readTransportShapes } from "./dto.js";
|
|
21
|
+
import { jacksonDtoReach, reachedFor, shapeReach } from "./shape-reach.js";
|
|
21
22
|
import { anchorOf, identityPackage, sourceRootOf } from "./roots.js";
|
|
22
23
|
export const ADAPTER_ID = "adapter-java";
|
|
23
24
|
/** The installed package's own declared version — read directly from this
|
|
@@ -147,7 +148,23 @@ export function createJavaAdapter(options = {}) {
|
|
|
147
148
|
* `client-base-extractor` stays absent — no composed base URL is read,
|
|
148
149
|
* so DEC-164's strict patterns 08a/08b/08c are unaddressed.
|
|
149
150
|
*/
|
|
150
|
-
nodeTypes: [
|
|
151
|
+
nodeTypes: [
|
|
152
|
+
"MODULE",
|
|
153
|
+
"CLASS",
|
|
154
|
+
"FUNCTION",
|
|
155
|
+
"TEST_CASE",
|
|
156
|
+
"API_ROUTE",
|
|
157
|
+
"API_ENDPOINT",
|
|
158
|
+
"MODEL",
|
|
159
|
+
// `DTO`, and the reason DEC-043 refused it no longer holds HERE.
|
|
160
|
+
// It refused a name rule over three classes separable only by name,
|
|
161
|
+
// and that refusal stands — `dto.ts` never reads the class to decide.
|
|
162
|
+
// A class is a transport shape because a ROUTE declares it one:
|
|
163
|
+
// `@RestController` makes a handler's return type the response body,
|
|
164
|
+
// `@RequestBody` makes a parameter's type the request body. The
|
|
165
|
+
// markers are on the route, so the entity beside them is untouched.
|
|
166
|
+
"DTO",
|
|
167
|
+
],
|
|
151
168
|
edgeTypes: [
|
|
152
169
|
"IMPORTS",
|
|
153
170
|
"CALLS",
|
|
@@ -157,6 +174,23 @@ export function createJavaAdapter(options = {}) {
|
|
|
157
174
|
"USES_TYPE",
|
|
158
175
|
"SERVES_API",
|
|
159
176
|
"USES_API",
|
|
177
|
+
/**
|
|
178
|
+
* `READS` is declared because `extract.ts`'s `mappedFieldRead`
|
|
179
|
+
* emits it — golden 07, `FUNCTION --READS--> MODEL` for
|
|
180
|
+
* `order.getTotalAmount()`. It is admitted only where a JPA mapping
|
|
181
|
+
* and a JavaBeans accessor agree on the same column (the four
|
|
182
|
+
* conditions are written out there), and it carries R2: the edge
|
|
183
|
+
* names a member, it does not compare a shape, and the shape it
|
|
184
|
+
* points at is already the `MODEL` node's own R3 fact.
|
|
185
|
+
*
|
|
186
|
+
* `ASSIGNS` deliberately does **not** follow. A setter call is a
|
|
187
|
+
* write, and filing one as a read states the opposite of what the
|
|
188
|
+
* code does — but the write half needs its own admission rules and
|
|
189
|
+
* its own measurement, and declaring the edge type before the pass
|
|
190
|
+
* exists is how `adapter-php` once published reads that were
|
|
191
|
+
* writes.
|
|
192
|
+
*/
|
|
193
|
+
"READS",
|
|
160
194
|
],
|
|
161
195
|
hasCallHierarchy: false,
|
|
162
196
|
hasTypeHierarchy: false,
|
|
@@ -177,7 +211,18 @@ export function createJavaAdapter(options = {}) {
|
|
|
177
211
|
// reader supplies, already stated correctly in `frameworkCapabilities`
|
|
178
212
|
// below. Listing it twice claimed five bound extractors where four exist.
|
|
179
213
|
frameworkExtractors: ["spring", "jaxrs", "jpa", "spring-data-mongodb"],
|
|
180
|
-
|
|
214
|
+
// `client-base-extractor` (DEC-164): declared because it is emitted —
|
|
215
|
+
// a `WebClient.create(base)`/`.baseUrl(base)`/`.rootUri(base)`
|
|
216
|
+
// declaration this reader can see composes per DEC-097 with the origin
|
|
217
|
+
// stripped, and every caller whose receiver's declaration it saw
|
|
218
|
+
// carries `attrs.clientBase`.
|
|
219
|
+
frameworkCapabilities: [
|
|
220
|
+
ROUTE_EXTRACTOR,
|
|
221
|
+
ORM_EXTRACTOR,
|
|
222
|
+
CLIENT_CALL_EXTRACTOR,
|
|
223
|
+
CLIENT_BASE_EXTRACTOR,
|
|
224
|
+
ROUTE_HANDLER_EXTRACTOR,
|
|
225
|
+
],
|
|
181
226
|
};
|
|
182
227
|
},
|
|
183
228
|
async prepare(ctx) {
|
|
@@ -237,7 +282,15 @@ export function createJavaAdapter(options = {}) {
|
|
|
237
282
|
// entity anywhere, where the highest level any fact in the same batch
|
|
238
283
|
// carries is 2. `shape-reach.ts` holds the reasoning; the rule is that
|
|
239
284
|
// the run publishes the level some fact in it actually carries.
|
|
240
|
-
|
|
285
|
+
// `DEC-NEXT-dto-shape-evidence-for-api-contracts`: a Jackson-annotated
|
|
286
|
+
// `DTO` is the second fact kind `shape-reach.ts` now recognises at R3,
|
|
287
|
+
// beside a JPA-mapped `MODEL` — computed here, once, the same way the
|
|
288
|
+
// entity map already is, so `reached` can never claim R3 for a batch
|
|
289
|
+
// where nothing in it actually earns the level.
|
|
290
|
+
const entities = units.length === 0 ? undefined : readEntities(units);
|
|
291
|
+
const reach = units.length === 0 || entities === undefined
|
|
292
|
+
? undefined
|
|
293
|
+
: shapeReach(entities, jacksonDtoReach(units, readTransportShapes(units), entities));
|
|
241
294
|
const reached = reachedFor(ceiling, units.length > 0, reach);
|
|
242
295
|
session = { root: ctx.root, files, units, reached, reach, failures, unfinished };
|
|
243
296
|
return reached;
|
|
@@ -287,7 +340,21 @@ export function createJavaAdapter(options = {}) {
|
|
|
287
340
|
if (active === undefined || active.units.length === 0) {
|
|
288
341
|
return { nodes: [], edges: [], unresolved: [] };
|
|
289
342
|
}
|
|
290
|
-
|
|
343
|
+
// A throw here used to escape `emit()`/`extractNodes()`/`extractEdges()`
|
|
344
|
+
// and be reported by the caller as the whole language being not
|
|
345
|
+
// analysable — indistinguishable from this adapter being broken for
|
|
346
|
+
// every repository. `extractOrDegrade` (`@descryy/adapter-common`) turns
|
|
347
|
+
// the throw into a disclosed, filesystem-level `FILE`-per-file fallback
|
|
348
|
+
// instead (`degradedGraph`, in `./extract.ts`) — see that function's doc
|
|
349
|
+
// comment for why `FILE`, not `MODULE`, is the right fallback for Java.
|
|
350
|
+
const degradedByThrow = (cause) => degradedGraph({
|
|
351
|
+
repo: active.root.repo,
|
|
352
|
+
workspace: active.root.workspace,
|
|
353
|
+
producedBy: PRODUCED_BY,
|
|
354
|
+
files: active.files,
|
|
355
|
+
cause,
|
|
356
|
+
});
|
|
357
|
+
return extractOrDegrade(() => extract({
|
|
291
358
|
repo: active.root.repo,
|
|
292
359
|
scope: { repo: active.root.repo, ...(active.root.workspace === undefined ? {} : { workspace: active.root.workspace }) },
|
|
293
360
|
producedBy: PRODUCED_BY,
|
|
@@ -296,7 +363,7 @@ export function createJavaAdapter(options = {}) {
|
|
|
296
363
|
// Already read in `prepare()`, to decide `reached` — handed on rather
|
|
297
364
|
// than resolved again, so deciding the level costs nothing.
|
|
298
365
|
...(active.reach === undefined ? {} : { entities: active.reach.entities }),
|
|
299
|
-
});
|
|
366
|
+
}), degradedByThrow);
|
|
300
367
|
}
|
|
301
368
|
}
|
|
302
369
|
/** Content hash of a repo-relative file, for `FileRef`. */
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAUL,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAwB,MAAM,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,IAAI,IAAI,QAAQ,EAAE,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client-base extractor for Java — DEC-164's contract.
|
|
3
|
+
*
|
|
4
|
+
* Spring is a base-on-the-client framework twice over. `WebClient.create(base)`
|
|
5
|
+
* and `WebClient.builder().baseUrl(base)` hold the origin on the client, and
|
|
6
|
+
* `RestTemplateBuilder.rootUri(base)` does the same for `RestTemplate`; a
|
|
7
|
+
* later `.uri("orders/{id}", id)` resolves against it at run time. So this
|
|
8
|
+
* binding takes C#'s shape — base on the client object, relative path at the
|
|
9
|
+
* call site — and not the spliced shape `adapter-go`, `adapter-rust` and
|
|
10
|
+
* `adapter-swift` had to use.
|
|
11
|
+
*
|
|
12
|
+
* `client.ts` already named this exact case before it could read it: a path
|
|
13
|
+
* with no leading slash was refused as a `capability-gap` whose own text says
|
|
14
|
+
* it "may resolve against a configured base URI this call site does not
|
|
15
|
+
* state". This is that base, read.
|
|
16
|
+
*
|
|
17
|
+
* ## Three states, and where each one comes from
|
|
18
|
+
*
|
|
19
|
+
* A client declaration whose initializer this reader can see and which sets a
|
|
20
|
+
* base earns `resolved` (a string literal, or a `String` constant in the same
|
|
21
|
+
* compilation unit) or `unresolved` (anything else — `System.getenv`, a
|
|
22
|
+
* config read, an injected value). A client declaration whose initializer is
|
|
23
|
+
* visible and sets NO base — `new RestTemplate()` — earns `none`, which is a
|
|
24
|
+
* positive statement. A receiver whose declaration this reader never saw
|
|
25
|
+
* earns DEC-164's fourth state, the field's own absence: the reader did not
|
|
26
|
+
* determine a base, which is not the same claim as there being none.
|
|
27
|
+
*
|
|
28
|
+
* ## The origin rule, and why it is evidence rather than a guess
|
|
29
|
+
*
|
|
30
|
+
* An absolute URL written at a call site is refused as out-of-scope
|
|
31
|
+
* (DEC-113), because the origin usually names a host this repository does not
|
|
32
|
+
* serve and DEC-014 makes an endpoint host-free. That stays, with the one
|
|
33
|
+
* exception `adapter-typescript` and `adapter-python` already adopted: **an
|
|
34
|
+
* origin some base in this same program resolves to is an origin this program
|
|
35
|
+
* treats as its own API.** Java needs it program-wide rather than per file,
|
|
36
|
+
* because one public class per file is not a style here but a rule — the
|
|
37
|
+
* constant and the absolute call site cannot be in the same file.
|
|
38
|
+
*
|
|
39
|
+
* ## The disclosed limit
|
|
40
|
+
*
|
|
41
|
+
* The constant table is per compilation unit. `OtherClass.API_BASE` read
|
|
42
|
+
* across files stays `unresolved` — a recall gap, never a precision one
|
|
43
|
+
* (rule 2), and the refusal row names the expression it could not read.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* DEC-164's contract, minus its fourth state — the field's own absence from
|
|
47
|
+
* `attrs`, which is a fact about the adapter rather than a value this type
|
|
48
|
+
* can hold.
|
|
49
|
+
*/
|
|
50
|
+
export type ClientBaseResult = {
|
|
51
|
+
/** A base traced to a literal. `path` is DEC-097's kept prefix, origin already stripped. */
|
|
52
|
+
readonly state: "resolved";
|
|
53
|
+
readonly path: string;
|
|
54
|
+
}
|
|
55
|
+
/** No base-setting mechanism in play. A positive statement, not a default. */
|
|
56
|
+
| {
|
|
57
|
+
readonly state: "none";
|
|
58
|
+
} | {
|
|
59
|
+
/** A base was configured and its value is not a literal this reader can evaluate. */
|
|
60
|
+
readonly state: "unresolved";
|
|
61
|
+
readonly why: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* DEC-097: the origin — scheme, host, port — is removed and the path prefix
|
|
65
|
+
* kept. `undefined` when the value is not an absolute URI this reader can
|
|
66
|
+
* split, which is refused rather than guessed at.
|
|
67
|
+
*
|
|
68
|
+
* Shared verbatim with `adapter-typescript`, `adapter-python`, `adapter-go`,
|
|
69
|
+
* `adapter-rust` and `adapter-swift` so they cannot drift; another spelling of
|
|
70
|
+
* this split is how a host reaches an id.
|
|
71
|
+
*/
|
|
72
|
+
export declare function pathPrefixOf(uri: string): string | undefined;
|
|
73
|
+
/** The scheme/host/port of an absolute URI, or `undefined` when it is not one. */
|
|
74
|
+
export declare function originOf(uri: string): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The prefix a base literal contributes, or `undefined` when it contributes
|
|
77
|
+
* none this reader can state.
|
|
78
|
+
*
|
|
79
|
+
* Two shapes resolve: an absolute URI, whose origin is discarded, and a
|
|
80
|
+
* repository-relative path, which is already what it composes to. Anything
|
|
81
|
+
* else — `"api/v1"`, with neither an origin to strip nor a leading slash to
|
|
82
|
+
* anchor it — makes no claim.
|
|
83
|
+
*/
|
|
84
|
+
export declare function prefixOfBaseLiteral(value: string): string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* One client declaration's own account of its base, as the parse saw it.
|
|
87
|
+
*
|
|
88
|
+
* `kind: "none"` is a real reading and not a default — it means the
|
|
89
|
+
* initializer was visible and set no base at all (`new RestTemplate()`). A
|
|
90
|
+
* declaration this reader never saw produces no site, which is DEC-164's
|
|
91
|
+
* fourth state.
|
|
92
|
+
*/
|
|
93
|
+
export type JavaBaseSite = {
|
|
94
|
+
readonly kind: "base";
|
|
95
|
+
/** The argument's own text, for a refusal that has to name what blocked it. */
|
|
96
|
+
readonly text: string;
|
|
97
|
+
/** Present when the argument is a bare string literal. */
|
|
98
|
+
readonly literal?: string;
|
|
99
|
+
/** Present when the argument is a bare name this reader can look up. */
|
|
100
|
+
readonly name?: string;
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: "none";
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Resolve a base site against the compilation unit's own `String` constants.
|
|
106
|
+
*
|
|
107
|
+
* `undefined` is never returned — a site exists precisely because the
|
|
108
|
+
* declaration was read, so one of the three states always applies.
|
|
109
|
+
*/
|
|
110
|
+
export declare function resolveBaseSite(site: JavaBaseSite, constants: ReadonlyMap<string, string>): {
|
|
111
|
+
readonly base: ClientBaseResult;
|
|
112
|
+
readonly origin?: string;
|
|
113
|
+
};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,YAAY,EAClB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAa/D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client-base extractor for Java — DEC-164's contract.
|
|
3
|
+
*
|
|
4
|
+
* Spring is a base-on-the-client framework twice over. `WebClient.create(base)`
|
|
5
|
+
* and `WebClient.builder().baseUrl(base)` hold the origin on the client, and
|
|
6
|
+
* `RestTemplateBuilder.rootUri(base)` does the same for `RestTemplate`; a
|
|
7
|
+
* later `.uri("orders/{id}", id)` resolves against it at run time. So this
|
|
8
|
+
* binding takes C#'s shape — base on the client object, relative path at the
|
|
9
|
+
* call site — and not the spliced shape `adapter-go`, `adapter-rust` and
|
|
10
|
+
* `adapter-swift` had to use.
|
|
11
|
+
*
|
|
12
|
+
* `client.ts` already named this exact case before it could read it: a path
|
|
13
|
+
* with no leading slash was refused as a `capability-gap` whose own text says
|
|
14
|
+
* it "may resolve against a configured base URI this call site does not
|
|
15
|
+
* state". This is that base, read.
|
|
16
|
+
*
|
|
17
|
+
* ## Three states, and where each one comes from
|
|
18
|
+
*
|
|
19
|
+
* A client declaration whose initializer this reader can see and which sets a
|
|
20
|
+
* base earns `resolved` (a string literal, or a `String` constant in the same
|
|
21
|
+
* compilation unit) or `unresolved` (anything else — `System.getenv`, a
|
|
22
|
+
* config read, an injected value). A client declaration whose initializer is
|
|
23
|
+
* visible and sets NO base — `new RestTemplate()` — earns `none`, which is a
|
|
24
|
+
* positive statement. A receiver whose declaration this reader never saw
|
|
25
|
+
* earns DEC-164's fourth state, the field's own absence: the reader did not
|
|
26
|
+
* determine a base, which is not the same claim as there being none.
|
|
27
|
+
*
|
|
28
|
+
* ## The origin rule, and why it is evidence rather than a guess
|
|
29
|
+
*
|
|
30
|
+
* An absolute URL written at a call site is refused as out-of-scope
|
|
31
|
+
* (DEC-113), because the origin usually names a host this repository does not
|
|
32
|
+
* serve and DEC-014 makes an endpoint host-free. That stays, with the one
|
|
33
|
+
* exception `adapter-typescript` and `adapter-python` already adopted: **an
|
|
34
|
+
* origin some base in this same program resolves to is an origin this program
|
|
35
|
+
* treats as its own API.** Java needs it program-wide rather than per file,
|
|
36
|
+
* because one public class per file is not a style here but a rule — the
|
|
37
|
+
* constant and the absolute call site cannot be in the same file.
|
|
38
|
+
*
|
|
39
|
+
* ## The disclosed limit
|
|
40
|
+
*
|
|
41
|
+
* The constant table is per compilation unit. `OtherClass.API_BASE` read
|
|
42
|
+
* across files stays `unresolved` — a recall gap, never a precision one
|
|
43
|
+
* (rule 2), and the refusal row names the expression it could not read.
|
|
44
|
+
*/
|
|
45
|
+
const ABSOLUTE = /^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/?#]*)(\/[^?#]*)?/;
|
|
46
|
+
/**
|
|
47
|
+
* DEC-097: the origin — scheme, host, port — is removed and the path prefix
|
|
48
|
+
* kept. `undefined` when the value is not an absolute URI this reader can
|
|
49
|
+
* split, which is refused rather than guessed at.
|
|
50
|
+
*
|
|
51
|
+
* Shared verbatim with `adapter-typescript`, `adapter-python`, `adapter-go`,
|
|
52
|
+
* `adapter-rust` and `adapter-swift` so they cannot drift; another spelling of
|
|
53
|
+
* this split is how a host reaches an id.
|
|
54
|
+
*/
|
|
55
|
+
export function pathPrefixOf(uri) {
|
|
56
|
+
const match = ABSOLUTE.exec(uri.trim());
|
|
57
|
+
if (match === null)
|
|
58
|
+
return undefined;
|
|
59
|
+
const path = match[2] ?? "";
|
|
60
|
+
return path === "/" ? "" : path.replace(/\/+$/, "");
|
|
61
|
+
}
|
|
62
|
+
/** The scheme/host/port of an absolute URI, or `undefined` when it is not one. */
|
|
63
|
+
export function originOf(uri) {
|
|
64
|
+
const match = ABSOLUTE.exec(uri.trim());
|
|
65
|
+
return match === null ? undefined : match[1];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The prefix a base literal contributes, or `undefined` when it contributes
|
|
69
|
+
* none this reader can state.
|
|
70
|
+
*
|
|
71
|
+
* Two shapes resolve: an absolute URI, whose origin is discarded, and a
|
|
72
|
+
* repository-relative path, which is already what it composes to. Anything
|
|
73
|
+
* else — `"api/v1"`, with neither an origin to strip nor a leading slash to
|
|
74
|
+
* anchor it — makes no claim.
|
|
75
|
+
*/
|
|
76
|
+
export function prefixOfBaseLiteral(value) {
|
|
77
|
+
if (value.startsWith("/"))
|
|
78
|
+
return value.length > 1 ? value.replace(/\/+$/, "") : "";
|
|
79
|
+
return pathPrefixOf(value);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resolve a base site against the compilation unit's own `String` constants.
|
|
83
|
+
*
|
|
84
|
+
* `undefined` is never returned — a site exists precisely because the
|
|
85
|
+
* declaration was read, so one of the three states always applies.
|
|
86
|
+
*/
|
|
87
|
+
export function resolveBaseSite(site, constants) {
|
|
88
|
+
if (site.kind === "none")
|
|
89
|
+
return { base: { state: "none" } };
|
|
90
|
+
const value = site.literal ?? (site.name === undefined ? undefined : constants.get(site.name));
|
|
91
|
+
if (value === undefined) {
|
|
92
|
+
return { base: { state: "unresolved", why: site.text.slice(0, 120) } };
|
|
93
|
+
}
|
|
94
|
+
const prefix = prefixOfBaseLiteral(value);
|
|
95
|
+
// A literal that is neither absolute nor repository-relative — `"api/v1"`.
|
|
96
|
+
// Nothing to strip and nothing to anchor it to, so no claim is made.
|
|
97
|
+
if (prefix === undefined)
|
|
98
|
+
return { base: { state: "unresolved", why: value.slice(0, 120) } };
|
|
99
|
+
const origin = originOf(value);
|
|
100
|
+
return { base: { state: "resolved", path: prefix }, ...(origin === undefined ? {} : { origin }) };
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=client-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-base.js","sourceRoot":"","sources":["../src/client-base.ts"],"names":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EAAE,EAAE,CAAC;IAE7D,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IACzE,CAAC;IACD,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IAC7F,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACpG,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -63,6 +63,10 @@
|
|
|
63
63
|
*/
|
|
64
64
|
import { type IdentityScope, type IRNode } from "@descryy/ir";
|
|
65
65
|
import type { JavaMethod, JavaRef } from "./parse.ts";
|
|
66
|
+
import { type ClientBaseResult } from "./client-base.ts";
|
|
67
|
+
export type { ClientBaseResult };
|
|
68
|
+
/** The origin set before any base has been read. Named so a caller cannot pass `new Set()` by accident and mean something else. */
|
|
69
|
+
export declare const NO_KNOWN_ORIGINS: ReadonlySet<string>;
|
|
66
70
|
export interface ClientCall {
|
|
67
71
|
/** The `FUNCTION` node making the call. */
|
|
68
72
|
readonly fromId: string;
|
|
@@ -72,6 +76,32 @@ export interface ClientCall {
|
|
|
72
76
|
readonly line: number;
|
|
73
77
|
/** `test` when the enclosing method is a test case, else `production`. */
|
|
74
78
|
readonly callerKind: "test" | "production";
|
|
79
|
+
/**
|
|
80
|
+
* DEC-164's contract — see `client-base.ts`. `undefined` is the fourth
|
|
81
|
+
* state: this reader never saw the receiver's declaration, so it did not
|
|
82
|
+
* determine a base, which is not the same claim as there being none.
|
|
83
|
+
*/
|
|
84
|
+
readonly clientBase?: ClientBaseResult;
|
|
85
|
+
/**
|
|
86
|
+
* The written type name of a `Type.class` literal this call passed as its
|
|
87
|
+
* sole class-literal argument — see {@link JavaRef.classLiteralArgument}.
|
|
88
|
+
* Still just a NAME here: `extract.ts` resolves it against the batch's
|
|
89
|
+
* declared types (the same `resolveType` every other name in this adapter
|
|
90
|
+
* goes through) and decides, from THAT declaration's own evidence, whether
|
|
91
|
+
* it earns `responseType`/`shapeResolution` on the `USES_API` edge —
|
|
92
|
+
* resolution needs cross-unit scope tables this file doesn't hold.
|
|
93
|
+
*/
|
|
94
|
+
readonly responseTypeWritten?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The resolved `DTO` node id {@link responseTypeWritten} names, set by
|
|
97
|
+
* `extract.ts` only once that declaration is both an established transport
|
|
98
|
+
* shape AND carries real Jackson evidence (`jackson.ts`) — never from
|
|
99
|
+
* {@link responseTypeWritten} alone. Present together with
|
|
100
|
+
* {@link shapeResolution}, or not at all.
|
|
101
|
+
*/
|
|
102
|
+
readonly responseType?: string;
|
|
103
|
+
/** DEC-058's carrier on the edge — see `jackson.ts`'s header for the gate this earns. */
|
|
104
|
+
readonly shapeResolution?: 3;
|
|
75
105
|
}
|
|
76
106
|
export interface ClientRefusal {
|
|
77
107
|
readonly fromId: string;
|
|
@@ -85,6 +115,14 @@ export interface ClientRefusal {
|
|
|
85
115
|
/** Diagnostic only, not part of DEC-242 — see `adapter-rust/src/client.ts`.
|
|
86
116
|
* Present only on `diagnoseArgument`'s generic fallthrough. */
|
|
87
117
|
readonly argumentKind?: "field" | "call" | "concatenation" | "other";
|
|
118
|
+
/** DEC-164's state, when this reader reached one. See `client-base.ts`. */
|
|
119
|
+
readonly clientBase?: ClientBaseResult;
|
|
120
|
+
/**
|
|
121
|
+
* The call's OWN path, with the unreadable base left off — golden 08b's
|
|
122
|
+
* requirement that a refusal name both halves. Without it the row says a
|
|
123
|
+
* base was unreadable and cannot say which call site it belonged to.
|
|
124
|
+
*/
|
|
125
|
+
readonly callPath?: string;
|
|
88
126
|
}
|
|
89
127
|
export type BaseRefusalClass = "value-unknown" | "varies-per-call" | "capability-gap";
|
|
90
128
|
/**
|
|
@@ -107,7 +145,16 @@ export declare function candidateClientRefs(method: JavaMethod): readonly (JavaR
|
|
|
107
145
|
* receiver to its declared type's simple name and is supplied by the caller
|
|
108
146
|
* — the scope rules live in `extract.ts`, and a second copy would drift.
|
|
109
147
|
*/
|
|
110
|
-
export declare function clientCalls(method: JavaMethod, fromId: string, typeOfReceiver: (name: string) => string | undefined, inTestSourceSet: boolean
|
|
148
|
+
export declare function clientCalls(method: JavaMethod, fromId: string, typeOfReceiver: (name: string) => string | undefined, inTestSourceSet: boolean,
|
|
149
|
+
/**
|
|
150
|
+
* DEC-164: the base configured on the receiver named here, or `undefined`
|
|
151
|
+
* when this reader never saw its declaration. Supplied by `extract.ts`,
|
|
152
|
+
* which holds the scope tables a second copy would drift from — the same
|
|
153
|
+
* division of labour `typeOfReceiver` already keeps.
|
|
154
|
+
*/
|
|
155
|
+
clientBaseOfReceiver?: (name: string) => ClientBaseResult | undefined,
|
|
156
|
+
/** Origins some base in this same program resolves to — see `client-base.ts`'s header. */
|
|
157
|
+
knownOrigins?: ReadonlySet<string>): {
|
|
111
158
|
readonly calls: readonly ClientCall[];
|
|
112
159
|
readonly refusals: readonly ClientRefusal[];
|
|
113
160
|
};
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,mIAAmI;AACnI,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAa,CAAC;AA0G/D,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,UAAU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AAE,OAAO;AACxB;;;;;GAKG;AACH,oBAAoB,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,GAAG,SAA2B;AACtF,0FAA0F;AAC1F,YAAY,GAAE,WAAW,CAAC,MAAM,CAAoB,GACnD;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CA8NxF;AAED;+EAC+E;AAC/E,wBAAgB,WAAW,CACzB,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GACtC,MAAM,CAaR"}
|
package/dist/client.js
CHANGED
|
@@ -62,6 +62,9 @@
|
|
|
62
62
|
* missing the hard way, a guard that dropped 113 of 140 call sites silently.
|
|
63
63
|
*/
|
|
64
64
|
import { endpointQsp, nodeId } from "@descryy/ir";
|
|
65
|
+
import { originOf, pathPrefixOf } from "./client-base.js";
|
|
66
|
+
/** The origin set before any base has been read. Named so a caller cannot pass `new Set()` by accident and mean something else. */
|
|
67
|
+
export const NO_KNOWN_ORIGINS = new Set();
|
|
65
68
|
/**
|
|
66
69
|
* Client types whose methods name an outbound HTTP call.
|
|
67
70
|
*
|
|
@@ -241,12 +244,58 @@ export function candidateClientRefs(method) {
|
|
|
241
244
|
* receiver to its declared type's simple name and is supplied by the caller
|
|
242
245
|
* — the scope rules live in `extract.ts`, and a second copy would drift.
|
|
243
246
|
*/
|
|
244
|
-
export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet
|
|
247
|
+
export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet,
|
|
248
|
+
/**
|
|
249
|
+
* DEC-164: the base configured on the receiver named here, or `undefined`
|
|
250
|
+
* when this reader never saw its declaration. Supplied by `extract.ts`,
|
|
251
|
+
* which holds the scope tables a second copy would drift from — the same
|
|
252
|
+
* division of labour `typeOfReceiver` already keeps.
|
|
253
|
+
*/
|
|
254
|
+
clientBaseOfReceiver = () => undefined,
|
|
255
|
+
/** Origins some base in this same program resolves to — see `client-base.ts`'s header. */
|
|
256
|
+
knownOrigins = NO_KNOWN_ORIGINS) {
|
|
245
257
|
const calls = [];
|
|
246
258
|
const refusals = [];
|
|
259
|
+
/**
|
|
260
|
+
* DEC-164's 08c, and the one narrow exception to DEC-113: an origin some
|
|
261
|
+
* base in this same program resolves to is an origin this program treats as
|
|
262
|
+
* its own API, so the path under it is a path in this repository. A bare
|
|
263
|
+
* origin with no path is not an endpoint anything serves.
|
|
264
|
+
*/
|
|
265
|
+
const pathAtKnownOrigin = (literal) => {
|
|
266
|
+
const origin = originOf(literal);
|
|
267
|
+
if (origin === undefined || !knownOrigins.has(origin))
|
|
268
|
+
return undefined;
|
|
269
|
+
const cut = literal.indexOf("?");
|
|
270
|
+
const path = pathPrefixOf(cut === -1 ? literal : literal.slice(0, cut));
|
|
271
|
+
return path === undefined || path === "" ? undefined : path;
|
|
272
|
+
};
|
|
247
273
|
/** Read `ref`'s first argument as a path and push a `ClientCall` or refusal
|
|
248
274
|
* — the shared tail for a verb from `VERB` or from {@link BUILDER_VERB}. */
|
|
249
|
-
const readPathAndEmit = (receiverType, ref, verb, refuse
|
|
275
|
+
const readPathAndEmit = (receiverType, ref, verb, refuse,
|
|
276
|
+
/** The name whose declaration carries the base — the CLIENT, not the fluent-chain step. */
|
|
277
|
+
baseHolder) => {
|
|
278
|
+
const clientBase = clientBaseOfReceiver(baseHolder);
|
|
279
|
+
const carry = clientBase === undefined ? {} : { clientBase };
|
|
280
|
+
const responseTypeCarry = ref.classLiteralArgument === undefined ? {} : { responseTypeWritten: ref.classLiteralArgument };
|
|
281
|
+
if (clientBase?.state === "unresolved" && ref.firstStringArgument !== undefined) {
|
|
282
|
+
// DEC-164 §2: a base injected from outside the readable source cannot be
|
|
283
|
+
// composed and must not be guessed. No edge, and the row names BOTH
|
|
284
|
+
// halves — the blocking expression and the call's own path.
|
|
285
|
+
const own = ref.firstStringArgument.split("?", 1)[0] ?? ref.firstStringArgument;
|
|
286
|
+
refusals.push({
|
|
287
|
+
fromId,
|
|
288
|
+
raw: ref.raw,
|
|
289
|
+
line: ref.line,
|
|
290
|
+
reason: `an HTTP call through ${receiverType} to \`${ref.firstStringArgument}\`, whose base this reader ` +
|
|
291
|
+
`traced to \`${clientBase.why}\` and could not read as a literal. DEC-164 refuses rather than ` +
|
|
292
|
+
`guesses what an unreadable base composes to.`,
|
|
293
|
+
...diagnoseArgument(clientBase.why, method.parameterNames),
|
|
294
|
+
clientBase,
|
|
295
|
+
callPath: own.startsWith("/") ? own : `/${own}`,
|
|
296
|
+
});
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
250
299
|
if (ref.firstStringArgument === undefined) {
|
|
251
300
|
refuse(`an HTTP call through ${receiverType}, but its path is not a bare string literal — a ` +
|
|
252
301
|
`variable, a concatenation, or a builder. A path assembled at run time is not one ` +
|
|
@@ -257,10 +306,42 @@ export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet) {
|
|
|
257
306
|
const template = relativePath(ref.firstStringArgument);
|
|
258
307
|
if (template === undefined) {
|
|
259
308
|
if (namesAnotherOrigin(ref.firstStringArgument)) {
|
|
309
|
+
const under = pathAtKnownOrigin(ref.firstStringArgument);
|
|
310
|
+
if (under !== undefined) {
|
|
311
|
+
calls.push({
|
|
312
|
+
fromId,
|
|
313
|
+
method: ref.name,
|
|
314
|
+
template: under,
|
|
315
|
+
verb,
|
|
316
|
+
line: ref.line,
|
|
317
|
+
callerKind: method.isTest || inTestSourceSet ? "test" : "production",
|
|
318
|
+
...carry,
|
|
319
|
+
...responseTypeCarry,
|
|
320
|
+
});
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
260
323
|
refuse(`an HTTP call through ${receiverType} to \`${ref.firstStringArgument}\`, which names ` +
|
|
261
324
|
`another origin rather than a path in this repository. A scope boundary, not a gap.`, { blockedBy: null, refusalClass: "out-of-scope" });
|
|
262
325
|
return;
|
|
263
326
|
}
|
|
327
|
+
// DEC-164: a base this reader DID read turns the bare-relative path
|
|
328
|
+
// from an undetermined one into a composed one. The refusal below is
|
|
329
|
+
// the case where there is no such base, and its own text has always
|
|
330
|
+
// said so ("against a configured base URI this call site does not
|
|
331
|
+
// state").
|
|
332
|
+
if (clientBase?.state === "resolved") {
|
|
333
|
+
calls.push({
|
|
334
|
+
fromId,
|
|
335
|
+
method: ref.name,
|
|
336
|
+
template: `${clientBase.path}/${(ref.firstStringArgument.split("?", 1)[0] ?? "").replace(/^\/+/, "")}`,
|
|
337
|
+
verb,
|
|
338
|
+
line: ref.line,
|
|
339
|
+
callerKind: method.isTest || inTestSourceSet ? "test" : "production",
|
|
340
|
+
...carry,
|
|
341
|
+
...responseTypeCarry,
|
|
342
|
+
});
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
264
345
|
// A bare relative path, no leading slash, no scheme — structurally like
|
|
265
346
|
// C#'s `HttpClient.BaseAddress` case. May resolve against a configured
|
|
266
347
|
// root URI (`RootUriTemplateHandler`, `baseUrl(...)`) this reader can't
|
|
@@ -279,6 +360,8 @@ export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet) {
|
|
|
279
360
|
template,
|
|
280
361
|
verb,
|
|
281
362
|
line: ref.line,
|
|
363
|
+
...carry,
|
|
364
|
+
...responseTypeCarry,
|
|
282
365
|
// Source set, not just the annotation: `method.isTest` reads `@Test`,
|
|
283
366
|
// but shopizer's `ServicesTestSupport.getHeader` drives
|
|
284
367
|
// `TestRestTemplate` from an unannotated helper — annotation alone
|
|
@@ -312,7 +395,7 @@ export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet) {
|
|
|
312
395
|
`or none, and root-cause traversal would follow it.`, CAPABILITY_GAP);
|
|
313
396
|
continue;
|
|
314
397
|
}
|
|
315
|
-
readPathAndEmit(receiverType, ref, verb, refuse);
|
|
398
|
+
readPathAndEmit(receiverType, ref, verb, refuse, base);
|
|
316
399
|
continue;
|
|
317
400
|
}
|
|
318
401
|
const receiverType = typeOfReceiver(ref.receiver);
|
|
@@ -347,7 +430,7 @@ export function clientCalls(method, fromId, typeOfReceiver, inTestSourceSet) {
|
|
|
347
430
|
`or none, and root-cause traversal would follow it.`, CAPABILITY_GAP);
|
|
348
431
|
continue;
|
|
349
432
|
}
|
|
350
|
-
readPathAndEmit(receiverType, ref, verb, refuse);
|
|
433
|
+
readPathAndEmit(receiverType, ref, verb, refuse, ref.receiver);
|
|
351
434
|
}
|
|
352
435
|
return { calls, refusals };
|
|
353
436
|
}
|