@descryy/adapter-csharp 0.1.0 → 0.3.0
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/LICENSE +8 -0
- package/dist/adapter.d.ts +3 -8
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +57 -65
- package/dist/adapter.js.map +1 -1
- package/dist/aspnetcore.d.ts +53 -95
- package/dist/aspnetcore.d.ts.map +1 -1
- package/dist/aspnetcore.js +56 -101
- package/dist/aspnetcore.js.map +1 -1
- package/dist/client-base.d.ts +51 -88
- package/dist/client-base.d.ts.map +1 -1
- package/dist/client-base.js +46 -79
- package/dist/client-base.js.map +1 -1
- package/dist/client.d.ts +42 -106
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +83 -172
- package/dist/client.js.map +1 -1
- package/dist/efcore.d.ts +59 -113
- package/dist/efcore.d.ts.map +1 -1
- package/dist/efcore.js +119 -204
- package/dist/efcore.js.map +1 -1
- package/dist/extract.d.ts +27 -50
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +154 -248
- package/dist/extract.js.map +1 -1
- package/dist/nullability.d.ts +46 -78
- package/dist/nullability.d.ts.map +1 -1
- package/dist/nullability.js +47 -80
- package/dist/nullability.js.map +1 -1
- package/dist/parse.d.ts +62 -102
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +60 -101
- package/dist/parse.js.map +1 -1
- package/dist/projects.d.ts +24 -40
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +38 -65
- package/dist/projects.js.map +1 -1
- package/package.json +15 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright (c) 2026 Descry
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software is proprietary and confidential. No license, express or
|
|
6
|
+
implied, to use, copy, modify, merge, publish, distribute, sublicense, or
|
|
7
|
+
sell copies of this software is granted without prior written permission
|
|
8
|
+
from the copyright holder.
|
package/dist/adapter.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The C# `LanguageAdapter` — all seven methods, breadth tier.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `IMPLEMENTS` and `INHERITS` are both claimed, and DEC-084 is what makes the
|
|
8
|
-
* second honest: C# writes `class A : B, IC` without saying which entry is the
|
|
9
|
-
* class, but the language guarantees at most one base class and requires it
|
|
10
|
-
* first — so only one entry per class declaration is ever ambiguous, and the
|
|
11
|
-
* `IFoo` naming convention is never read.
|
|
4
|
+
* `IMPLEMENTS`/`INHERITS` (DEC-084): `class A : B, IC` doesn't say which entry
|
|
5
|
+
* is the base class, but C# requires the base class first when present, so the
|
|
6
|
+
* first entry is unambiguous and the `IFoo` naming convention is never read.
|
|
12
7
|
*/
|
|
13
8
|
import { type LanguageAdapter, type ResolutionLevel } from "@descryy/ir";
|
|
14
9
|
import { toRepoRelative } from "@descryy/adapter-common";
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,EAKrB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAyB,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAatG,OAAO,EAAW,QAAQ,EAAmB,MAAM,cAAc,CAAC;AAElE,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,oBAAoB,sBAAuB,CAAC;AAUzD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC1C;AAuBD,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAsOrF;AAED,2DAA2D;AAC3D,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU7D;AAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/adapter.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The C# `LanguageAdapter` — all seven methods, breadth tier.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `IMPLEMENTS` and `INHERITS` are both claimed, and DEC-084 is what makes the
|
|
8
|
-
* second honest: C# writes `class A : B, IC` without saying which entry is the
|
|
9
|
-
* class, but the language guarantees at most one base class and requires it
|
|
10
|
-
* first — so only one entry per class declaration is ever ambiguous, and the
|
|
11
|
-
* `IFoo` naming convention is never read.
|
|
4
|
+
* `IMPLEMENTS`/`INHERITS` (DEC-084): `class A : B, IC` doesn't say which entry
|
|
5
|
+
* is the base class, but C# requires the base class first when present, so the
|
|
6
|
+
* first entry is unambiguous and the `IFoo` naming convention is never read.
|
|
12
7
|
*/
|
|
13
8
|
import { createHash } from "node:crypto";
|
|
14
9
|
import { createRequire } from "node:module";
|
|
@@ -36,7 +31,17 @@ export function createCsharpAdapter(options = {}) {
|
|
|
36
31
|
const ceiling = options.maxResolution ?? 2;
|
|
37
32
|
let session;
|
|
38
33
|
let parser;
|
|
39
|
-
|
|
34
|
+
let nestedCheckouts = [];
|
|
35
|
+
let ignoredByProject = [];
|
|
36
|
+
const filesUnder = (root) => {
|
|
37
|
+
const nested = [];
|
|
38
|
+
const found = discover(root.absolutePath, globs, {
|
|
39
|
+
onNestedCheckout: (dir) => nested.push(dir),
|
|
40
|
+
onIgnored: (names) => (ignoredByProject = names),
|
|
41
|
+
}).filter((file) => !isBuildOutput(file));
|
|
42
|
+
nestedCheckouts = nested;
|
|
43
|
+
return found;
|
|
44
|
+
};
|
|
40
45
|
return {
|
|
41
46
|
id: ADAPTER_ID,
|
|
42
47
|
version: ADAPTER_VERSION,
|
|
@@ -58,72 +63,56 @@ export function createCsharpAdapter(options = {}) {
|
|
|
58
63
|
// two namespaces that collide have nothing to separate them.
|
|
59
64
|
evidence.push("no .csproj found — files belong to no assembly and cannot be separated by project");
|
|
60
65
|
}
|
|
66
|
+
for (const nested of nestedCheckouts) {
|
|
67
|
+
evidence.push(`skipped ${nested}: a separate checkout with its own .git`);
|
|
68
|
+
}
|
|
69
|
+
if (ignoredByProject.length > 0) {
|
|
70
|
+
evidence.push(`skipped ${ignoredByProject.length} director(ies) the project's own .gitignore excludes: ` +
|
|
71
|
+
`${ignoredByProject.slice(0, 12).join(", ")}`);
|
|
72
|
+
}
|
|
61
73
|
return { detected: files.length > 0, roots: files.length > 0 ? [root.absolutePath] : [], evidence };
|
|
62
74
|
},
|
|
63
75
|
capabilities() {
|
|
64
76
|
return {
|
|
65
77
|
maxResolution: ceiling,
|
|
66
78
|
/**
|
|
67
|
-
* `API_ROUTE
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* `IEntityTypeConfiguration<T>` — never from a name. DEC-043's objection
|
|
71
|
-
* was to the name heuristic, not to the node types.
|
|
79
|
+
* `API_ROUTE`/`API_ENDPOINT`/`MODEL`: earned from declarations (an
|
|
80
|
+
* attribute the framework acts on, `DbSet<T>`, `IEntityTypeConfiguration<T>`),
|
|
81
|
+
* never from a name — DEC-043 objected to the name heuristic, not the types.
|
|
72
82
|
*
|
|
73
|
-
* `DTO` stays absent
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* nothing distinguishes the DTO, so nothing claims it.
|
|
83
|
+
* `DTO` stays absent (golden 07): `Order` and `CreateOrderRequest` are
|
|
84
|
+
* structurally identical in the corpus, separable only by name — a
|
|
85
|
+
* mapping distinguishes the model, nothing distinguishes the DTO.
|
|
77
86
|
*
|
|
78
|
-
* `
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
87
|
+
* `USES_API`/`client-call-extractor`: `client.ts` (DEC-241 §4) reads
|
|
88
|
+
* `HttpClient` verb methods (`GetAsync`, `PostAsJsonAsync`, …) whose
|
|
89
|
+
* path is the call's first argument — same shape Java's `RestTemplate`
|
|
90
|
+
* extracts from. Mints edges for a repo-relative literal path; files a
|
|
91
|
+
* ledger row for everything else (pre-built `HttpRequestMessage` via
|
|
92
|
+
* `SendAsync`, non-literal path, other origin, unplaceable relative path).
|
|
82
93
|
*
|
|
83
|
-
* `
|
|
84
|
-
*
|
|
85
|
-
* `
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* every `USES_API` edge now carries `attrs.clientBase`, `resolved`
|
|
96
|
-
* when the receiver traces to `WebApplicationFactory<T>.CreateClient()`
|
|
97
|
-
* (ASP.NET's own integration-test client, whose documented default
|
|
98
|
-
* `BaseAddress` is the application under test — 100% of jellyfin's
|
|
99
|
-
* and eShopOnWeb's real `USES_API` population goes through exactly
|
|
100
|
-
* this receiver) and `none` otherwise, unchanged from this adapter's
|
|
101
|
-
* pre-DEC-164 behaviour. `unresolved` — a base-setting mechanism
|
|
102
|
-
* found but unreadable — is part of the contract and never produced
|
|
103
|
-
* by this build: the one registration shape with real corpus
|
|
104
|
-
* evidence (`AddHttpClient<T>(o => o.BaseAddress = new("..."))`,
|
|
105
|
-
* `dotnet/eShop`, 4 sites) feeds call sites already blocked by string
|
|
106
|
-
* interpolation, a separate and larger gap, so resolving it would
|
|
107
|
-
* move zero measured edges. `IHttpClientFactory.CreateClient(name)`'s
|
|
108
|
-
* named-client form is a different, real, unaddressed DI shape —
|
|
109
|
-
* every such call was invisible before this row and stays exactly
|
|
110
|
-
* as invisible after it.
|
|
94
|
+
* `client-base-extractor` (DEC-164, patterns 08a/08b/08c — full account
|
|
95
|
+
* in `client-base.ts`): every `USES_API` edge carries `attrs.clientBase`,
|
|
96
|
+
* `resolved` when the receiver traces to
|
|
97
|
+
* `WebApplicationFactory<T>.CreateClient()` (ASP.NET's integration-test
|
|
98
|
+
* client, default `BaseAddress` is the app under test — 100% of
|
|
99
|
+
* jellyfin's and eShopOnWeb's real `USES_API` population uses this
|
|
100
|
+
* receiver), `none` otherwise. `unresolved` is part of the contract but
|
|
101
|
+
* never produced here: the one corpus shape with real evidence
|
|
102
|
+
* (`AddHttpClient<T>(o => o.BaseAddress = new("..."))`, `dotnet/eShop`,
|
|
103
|
+
* 4 sites) feeds call sites already blocked by string interpolation, so
|
|
104
|
+
* resolving it would move zero edges. `IHttpClientFactory.CreateClient(name)`
|
|
105
|
+
* is a separate, unaddressed DI shape.
|
|
111
106
|
*/
|
|
112
107
|
nodeTypes: ["MODULE", "CLASS", "FUNCTION", "TEST_CASE", "API_ROUTE", "API_ENDPOINT", "MODEL"],
|
|
113
108
|
edgeTypes: ["IMPORTS", "CALLS", "TESTS", "INHERITS", "IMPLEMENTS", "USES_TYPE", "SERVES_API", "USES_API"],
|
|
114
109
|
hasCallHierarchy: false,
|
|
115
110
|
hasTypeHierarchy: false,
|
|
116
111
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* in
|
|
120
|
-
*
|
|
121
|
-
* `projects.ts` already excludes all four — `obj/` in particular would put a second
|
|
122
|
-
* copy of every generated source in the graph, "the same reason Go excludes
|
|
123
|
-
* vendor/".
|
|
124
|
-
*
|
|
125
|
-
* Names only — the walk matches one path component, so a path or glob matches
|
|
126
|
-
* nothing. Nothing dotted — those are skipped structurally already.
|
|
112
|
+
* Dependency/build-output directories (DEC-110). `projects.ts` already
|
|
113
|
+
* excludes all four — `obj/` would otherwise duplicate every generated
|
|
114
|
+
* source in the graph, same reason Go excludes `vendor/`. Names only,
|
|
115
|
+
* matched as one path component; dotted dirs are already skipped structurally.
|
|
127
116
|
*/
|
|
128
117
|
noiseDirectories: ["bin", "obj", "packages", "node_modules"],
|
|
129
118
|
frameworkExtractors: ["aspnetcore", "efcore", "client-call-extractor", "client-base-extractor"],
|
|
@@ -236,9 +225,8 @@ export function createCsharpAdapter(options = {}) {
|
|
|
236
225
|
reached: active.reached,
|
|
237
226
|
files: active.units,
|
|
238
227
|
sources: active.sources,
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
// values keeps the precedence in one place.
|
|
228
|
+
// Two of DEC-180 §1's three sources live only in this layer; a resolver
|
|
229
|
+
// (not raw values) keeps precedence in one place.
|
|
242
230
|
nullableContextOf: (file) => {
|
|
243
231
|
const project = projectOf(active.projects, file);
|
|
244
232
|
return resolveNullable({
|
|
@@ -255,8 +243,12 @@ export function hashOf(root, relative) {
|
|
|
255
243
|
try {
|
|
256
244
|
return createHash("sha256").update(readFileSync(join(root, relative))).digest("hex").slice(0, 32);
|
|
257
245
|
}
|
|
258
|
-
catch {
|
|
259
|
-
|
|
246
|
+
catch (error) {
|
|
247
|
+
// Disclosed gap, not a hash: "" would collide every unreadable file onto one
|
|
248
|
+
// value, hiding a later readable/unreadable flip (C-F7). This marker can't
|
|
249
|
+
// equal a real 32-hex hash, and is keyed by path so unreadable files don't collide.
|
|
250
|
+
const code = error instanceof Error && "code" in error ? String(error.code) : "UNKNOWN";
|
|
251
|
+
return `unreadable:${code}:${relative}`;
|
|
260
252
|
}
|
|
261
253
|
}
|
|
262
254
|
export { LANGUAGE, toRepoRelative };
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src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
-
*
|
|
5
|
-
* DEC-
|
|
6
|
-
* re-counting in the unit the rules decide, and that amendment is most of what
|
|
7
|
-
* is load-bearing here.
|
|
4
|
+
* An `API_ROUTE` is a framework claim, earned here. DEC-128 §1 set the rules;
|
|
5
|
+
* DEC-181 amended them after re-counting.
|
|
8
6
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* controller is `[ApiController]` or a `ControllerBase` base. Counted in files:
|
|
7
|
+
* Evidence is on an ancestor, subject is the descendant. DEC-128 §1a admits
|
|
8
|
+
* a `[HttpGet]` method on a controller (`[ApiController]` or `ControllerBase`
|
|
9
|
+
* base). Counted in files:
|
|
13
10
|
*
|
|
14
11
|
* | corpus | files with a verb attribute | directly admissible | **need the base chain** |
|
|
15
12
|
* | --- | --- | --- | --- |
|
|
@@ -17,39 +14,27 @@
|
|
|
17
14
|
* | `Ocelot` | 9 | 9 | 0 |
|
|
18
15
|
* | `eShopOnWeb` | 4 | 3 | 1 |
|
|
19
16
|
*
|
|
20
|
-
* Every
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* This is the **third instance of one construct class**: the evidence sits on an
|
|
27
|
-
* ancestor and the subject is the descendant. JPA's `@MappedSuperclass` cost a
|
|
28
|
-
* third of an entity population; this is 98% of a corpus. It is checked for by
|
|
29
|
-
* name now rather than met by surprise.
|
|
30
|
-
*
|
|
31
|
-
* ## `[controller]` expands against the SUBJECT class, not the declaring one
|
|
32
|
-
*
|
|
33
|
-
* The `[Route("[controller]")]` governing 61 `jellyfin` controllers is declared
|
|
34
|
-
* **once, on the base**. A reader expanding the token where it finds the
|
|
35
|
-
* attribute produces `BaseJellyfinApi` sixty-one times — **one wrong template,
|
|
36
|
-
* sixty-one routes**. That is a wrong answer where the recall hole above is only
|
|
37
|
-
* a silence, and rule 2 does not treat them the same.
|
|
17
|
+
* Every jellyfin controller is `class XController : BaseJellyfinApiController`,
|
|
18
|
+
* whose base carries `[ApiController]`/`[Route("[controller]")]` — checking
|
|
19
|
+
* only the class admits 1 of 62 and misses ~400 verb attributes. Third
|
|
20
|
+
* instance of this construct class after JPA's `@MappedSuperclass` (cost a
|
|
21
|
+
* third of an entity population) and ASP.NET's own base controller (98% of a corpus).
|
|
38
22
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
23
|
+
* `[controller]` expands against the SUBJECT class, not the declaring one:
|
|
24
|
+
* the token governing 61 jellyfin controllers is declared once, on the base
|
|
25
|
+
* — expanding it where the attribute lives would give `BaseJellyfinApi`
|
|
26
|
+
* sixty-one times, one wrong template producing sixty-one wrong routes (a
|
|
27
|
+
* wrong answer, not a silence — rule 2 treats them differently). The
|
|
28
|
+
* template is inherited; the name substituted into it never is.
|
|
42
29
|
*
|
|
30
|
+
* A derived `[Route]` REPLACES an inherited one, it does not join:
|
|
43
31
|
* `ActivityLogController` carries `[Route("System/ActivityLog")]` while
|
|
44
|
-
* inheriting `[Route("[controller]")]
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* alike — which is the trap. **Before reusing a composition rule on a new pair,
|
|
49
|
-
* establish that the new pair composes at all.** Class↔method concatenates;
|
|
50
|
-
* class↔base overrides.
|
|
32
|
+
* inheriting `[Route("[controller]")]` — ASP.NET takes the most-derived. §1a
|
|
33
|
+
* *does* join class template to method template, so before reusing a
|
|
34
|
+
* composition rule on a new pair, confirm the pair composes at all:
|
|
35
|
+
* class↔method concatenates, class↔base overrides.
|
|
51
36
|
*
|
|
52
|
-
*
|
|
37
|
+
* Both mechanisms, counted apart:
|
|
53
38
|
*
|
|
54
39
|
* | corpus | verb attributes | `Map*` | `MapGroup` |
|
|
55
40
|
* | --- | --- | --- | --- |
|
|
@@ -58,12 +43,10 @@
|
|
|
58
43
|
* | `eShopOnWeb` | 26 | 7 | 0 |
|
|
59
44
|
* | `CleanArchitecture` | **0** | **15** | **1** |
|
|
60
45
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* degraded number
|
|
64
|
-
*
|
|
65
|
-
* — stated rather than discovered later, because a rule with one witness is not
|
|
66
|
-
* measured.
|
|
46
|
+
* CleanArchitecture is attribute-free, jellyfin is minimal-API-free, so
|
|
47
|
+
* supporting one mechanism scores zero on a whole corpus rather than a
|
|
48
|
+
* degraded number — counted separately so a total miss can't average out.
|
|
49
|
+
* `MapGroup` has one witness in the entire control set.
|
|
67
50
|
*/
|
|
68
51
|
import type { CsFile } from "./parse.ts";
|
|
69
52
|
export interface AspNetRoute {
|
|
@@ -103,20 +86,13 @@ export interface AspNetCensus {
|
|
|
103
86
|
/** Base names that leave the analysed set; not assumed to reach ControllerBase. */
|
|
104
87
|
readonly baseChainsLeftAnalysedSet: number;
|
|
105
88
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* The gap is not closable by reading the name: admitting a class because its
|
|
115
|
-
* base is *called* something ending in `Endpoint` is the name rule this
|
|
116
|
-
* project forbids, and it is what pattern 15 exists to punish. Closing it
|
|
117
|
-
* honestly needs the package analysed, and dependencies are never installed
|
|
118
|
-
* here. So it is **named** instead, which is the difference between a
|
|
119
|
-
* disclosed gap a reader can act on and a number they cannot.
|
|
89
|
+
* Which base names left the set, with a count each — a bare total isn't
|
|
90
|
+
* actionable. `eShopOnWeb` reports 30 such chains, and at least one
|
|
91
|
+
* (`EndpointBaseAsync.WithRequest<T>.WithActionResult<T>` from
|
|
92
|
+
* `Ardalis.ApiEndpoints`) is a real controller base serving real routes
|
|
93
|
+
* this graph doesn't have. Not closable by name (that's pattern 15's rule),
|
|
94
|
+
* needs the package analysed — dependencies are never installed here, so
|
|
95
|
+
* it's named instead, a disclosed gap rather than an unactionable number.
|
|
120
96
|
*/
|
|
121
97
|
readonly unresolvedBases: readonly {
|
|
122
98
|
readonly name: string;
|
|
@@ -124,12 +100,10 @@ export interface AspNetCensus {
|
|
|
124
100
|
}[];
|
|
125
101
|
/**
|
|
126
102
|
* The same population as {@link unresolvedBases}, per site rather than
|
|
127
|
-
* aggregated
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* this census and the graph a caller actually reads. See `extract.ts`'s
|
|
132
|
-
* own `SERVES_API` ledger call for where this closes.
|
|
103
|
+
* aggregated — what `extract.ts` actually ledgers. Before this field
|
|
104
|
+
* existed, the aggregate count was computed correctly but never reached
|
|
105
|
+
* `emit()`'s `unresolved: UnresolvedRef[]` — a real refusal silently
|
|
106
|
+
* dropped between census and graph. See `extract.ts`'s `SERVES_API` ledger call.
|
|
133
107
|
*/
|
|
134
108
|
readonly unresolvedBaseSites: readonly AspNetUnresolvedBaseSite[];
|
|
135
109
|
/** Mapping sites whose path is not a literal. Refused, per DEC-128 §1. */
|
|
@@ -143,48 +117,32 @@ export interface AspNetCensus {
|
|
|
143
117
|
* `Map*` sites whose receiver is not a known group in a file that declares
|
|
144
118
|
* groups. Refused, because the route may belong to one.
|
|
145
119
|
*
|
|
146
|
-
* DEC-128 §1b:
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* the gap register said was missing.
|
|
120
|
+
* DEC-128 §1b: unavailable means the route emits with its suffix only,
|
|
121
|
+
* flagged unresolved, never silently as if the suffix were the whole path.
|
|
122
|
+
* The first version emitted suffix-only with no flag — found by adding the
|
|
123
|
+
* corpus the gap register said was missing.
|
|
151
124
|
*/
|
|
152
125
|
readonly minimalRefusedUnknownGroup: number;
|
|
153
126
|
}
|
|
154
127
|
/**
|
|
155
|
-
* Does this file import ASP.NET's routing surface?
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* project. `efcore.ts` records the measured cost of ignoring it: nine `DbSet<T>`
|
|
160
|
-
* read as zero because the `using` sat three files away.
|
|
161
|
-
*
|
|
162
|
-
* Scoped by assembly, because a global using in one project does not reach
|
|
163
|
-
* another.
|
|
128
|
+
* Does this file import ASP.NET's routing surface? A `global using` counts,
|
|
129
|
+
* in force across the assembly (modern C#'s .NET 6+ implicit global usings;
|
|
130
|
+
* `efcore.ts` measured the cost of ignoring it — nine `DbSet<T>` read as zero).
|
|
131
|
+
* Scoped by assembly — a global using in one project doesn't reach another.
|
|
164
132
|
*/
|
|
165
133
|
export declare function importsAspNet(file: CsFile, globalsByAssembly?: ReadonlyMap<string, boolean>): boolean;
|
|
166
134
|
/**
|
|
167
|
-
* Normalise a route template to its joinable form.
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* joins to nothing. Golden 04's note names `{id:guid}` explicitly.
|
|
172
|
-
*
|
|
173
|
-
* The *written* form is kept beside this one. Identity normalises and fidelity
|
|
174
|
-
* preserves; collapsing to one deletes a fact that surfaces as a clean zero
|
|
175
|
-
* somewhere else.
|
|
135
|
+
* Normalise a route template to its joinable form. `{id}`, `{id:int}`,
|
|
136
|
+
* `{id:guid}`, `{id?}`, `{*rest}` all serve the same URL shape and must mint
|
|
137
|
+
* the same endpoint id (golden 04 names `{id:guid}` explicitly). The written
|
|
138
|
+
* form is kept beside this one — identity normalises, fidelity preserves.
|
|
176
139
|
*/
|
|
177
140
|
export declare function normaliseTemplate(written: string): string;
|
|
178
141
|
/**
|
|
179
|
-
* Expand `[controller]`, `[action]
|
|
180
|
-
*
|
|
181
|
-
* `
|
|
182
|
-
*
|
|
183
|
-
* the `Controller` suffix, which is the framework's own rule and the one place a
|
|
184
|
-
* class name legitimately enters a path.
|
|
185
|
-
*
|
|
186
|
-
* A token this reader does not know yields `undefined`: the route is refused and
|
|
187
|
-
* logged rather than emitted with a guessed path.
|
|
142
|
+
* Expand `[controller]`, `[action]`, `[area]` against the SUBJECT (the
|
|
143
|
+
* most-derived class, never the declaring class — see file comment).
|
|
144
|
+
* `[controller]` drops the `Controller` suffix, the framework's own rule. An
|
|
145
|
+
* unknown token yields `undefined`: refused and logged, never guessed.
|
|
188
146
|
*/
|
|
189
147
|
export declare function expandTokens(template: string, subject: string, action: string): {
|
|
190
148
|
expanded: string;
|
package/dist/aspnetcore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspnetcore.d.ts","sourceRoot":"","sources":["../src/aspnetcore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"aspnetcore.d.ts","sourceRoot":"","sources":["../src/aspnetcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EA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