@descryy/adapter-kotlin 0.4.0 → 0.5.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/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +68 -10
- 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 +23 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +207 -13
- package/dist/client.js.map +1 -1
- package/dist/external.d.ts +149 -0
- package/dist/external.d.ts.map +1 -0
- package/dist/external.js +226 -0
- package/dist/external.js.map +1 -0
- package/dist/extract.d.ts +7 -0
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +321 -28
- package/dist/extract.js.map +1 -1
- package/dist/jpa-reads.d.ts +26 -0
- package/dist/jpa-reads.d.ts.map +1 -0
- package/dist/jpa-reads.js +35 -0
- package/dist/jpa-reads.js.map +1 -0
- package/dist/jpa.d.ts +147 -0
- package/dist/jpa.d.ts.map +1 -0
- package/dist/jpa.js +415 -0
- package/dist/jpa.js.map +1 -0
- package/dist/parse.d.ts +44 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +106 -9
- package/dist/parse.js.map +1 -1
- package/dist/shape-reach.d.ts +92 -0
- package/dist/shape-reach.d.ts.map +1 -0
- package/dist/shape-reach.js +129 -0
- package/dist/shape-reach.js.map +1 -0
- package/package.json +5 -5
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAWrB,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C;;;;;;kCAMkC;AAClC,eAAO,MAAM,eAAe,EAAE,MAErB,CAAC;AACV,eAAO,MAAM,oBAAoB,sBAAuB,CAAC;AACzD,eAAO,MAAM,QAAQ,WAAW,CAAC;AAuCjC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC1C;AAgBD,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,CAwSrF"}
|
package/dist/adapter.js
CHANGED
|
@@ -14,6 +14,7 @@ import { anchorOf, identityPackage, sourceRootOf } from "@descryy/adapter-jvm";
|
|
|
14
14
|
import { parserFor, parseText } from "@descryy/adapter-treesitter";
|
|
15
15
|
import { readKotlinFile } from "./parse.js";
|
|
16
16
|
import { extract } from "./extract.js";
|
|
17
|
+
import { readEntities, reachedFor } from "./shape-reach.js";
|
|
17
18
|
export const ADAPTER_ID = "adapter-kotlin";
|
|
18
19
|
/** The installed package's own declared version — read directly from this
|
|
19
20
|
* package's own package.json rather than hardcoded, so the two can never
|
|
@@ -58,7 +59,15 @@ function isGenerated(file) {
|
|
|
58
59
|
}
|
|
59
60
|
export function createKotlinAdapter(options = {}) {
|
|
60
61
|
const globs = options.globs ?? DEFAULT_KOTLIN_GLOBS;
|
|
61
|
-
|
|
62
|
+
/**
|
|
63
|
+
* The highest level this adapter *can* reach, not the level a given run
|
|
64
|
+
* does. 3 because `jpa.ts` mints a mapped field shape from a declared JPA
|
|
65
|
+
* mapping (DEC-202's ground, no type checker); what a run actually reached
|
|
66
|
+
* is `prepare()`'s return, which `shape-reach.ts` measures per repository
|
|
67
|
+
* instead of echoing this number back. A repository with no mapping in it
|
|
68
|
+
* cannot reach R3 by construction.
|
|
69
|
+
*/
|
|
70
|
+
const ceiling = options.maxResolution ?? 3;
|
|
62
71
|
let session;
|
|
63
72
|
let parser;
|
|
64
73
|
let nestedCheckouts = [];
|
|
@@ -81,6 +90,7 @@ export function createKotlinAdapter(options = {}) {
|
|
|
81
90
|
producedBy: PRODUCED_BY,
|
|
82
91
|
scope: { repo: live.root.repo, ...(live.root.workspace === undefined ? {} : { workspace: live.root.workspace }) },
|
|
83
92
|
reached: live.reached,
|
|
93
|
+
reach: live.reach,
|
|
84
94
|
});
|
|
85
95
|
};
|
|
86
96
|
return {
|
|
@@ -116,8 +126,12 @@ export function createKotlinAdapter(options = {}) {
|
|
|
116
126
|
"annotations (@RestController/@GetMapping/@RequestMapping) supply routes the same way Java's " +
|
|
117
127
|
"own reader does. Retrofit's declarative client interfaces (@GET/@POST on an interface method) " +
|
|
118
128
|
"supply the calls that reach them; raw OkHttp (OkHttpClient().newCall(...)) does not — measured " +
|
|
119
|
-
"at zero real call sites needing it, on two real corpora, see language-problems.md §9.
|
|
120
|
-
"
|
|
129
|
+
"at zero real call sites needing it, on two real corpora, see language-problems.md §9. JPA/" +
|
|
130
|
+
"Hibernate and Spring Data MongoDB mappings supply models and their column shapes, read from " +
|
|
131
|
+
"the same annotations adapter-java reads — but only where the column set can be shown " +
|
|
132
|
+
"COMPLETE: an unresolvable superclass, an @Entity superclass, an @Embedded property or an " +
|
|
133
|
+
"@Inheritance strategy each withhold the shape rather than report a partial column list as " +
|
|
134
|
+
"a whole one.");
|
|
121
135
|
evidence.push("no cross-language edges into Java-declared types are emitted. The reference corpus for " +
|
|
122
136
|
"that claim (okhttp) contains no Kotlin-to-Java reference at all, so the rule would " +
|
|
123
137
|
"ship unwitnessed.");
|
|
@@ -133,15 +147,36 @@ export function createKotlinAdapter(options = {}) {
|
|
|
133
147
|
},
|
|
134
148
|
capabilities() {
|
|
135
149
|
return {
|
|
150
|
+
/**
|
|
151
|
+
* The maximum, declared before any repository is read and therefore
|
|
152
|
+
* never a measurement. R3 is honest as a maximum because a JPA mapping
|
|
153
|
+
* *declares* a shape — see `shape-reach.ts` for what is and is not R3
|
|
154
|
+
* here, and why no `DATABASE_TABLE` is minted from it. A repository
|
|
155
|
+
* with no entity in it runs at R2 and says so in `reachedResolution`.
|
|
156
|
+
*/
|
|
136
157
|
maxResolution: ceiling,
|
|
137
|
-
|
|
158
|
+
/**
|
|
159
|
+
* `MODEL` is claimed: `jpa.ts` earns it from `@Entity`/`@Document`,
|
|
160
|
+
* an annotation, never from a name. `DTO` stays absent (golden 07):
|
|
161
|
+
* `Order`/`CreateOrderRequest` are structurally identical and
|
|
162
|
+
* separable only by name, so nothing distinguishes a DTO the way
|
|
163
|
+
* `@Entity` distinguishes a model.
|
|
164
|
+
*
|
|
165
|
+
* `COMPONENT` comes from the `compose` extractor and nothing else:
|
|
166
|
+
* `@Composable` + an `androidx.compose` import + a `Unit` return, which
|
|
167
|
+
* is Jetpack Compose's own definition of a UI element. Kotlin has no
|
|
168
|
+
* routed-page concept this adapter can read, so no `PAGE` is claimed —
|
|
169
|
+
* a `COMPONENT` here is never promoted, and pattern 17 grades that it
|
|
170
|
+
* is minted at all rather than that it resisted promotion.
|
|
171
|
+
*/
|
|
172
|
+
nodeTypes: ["MODULE", "CLASS", "FUNCTION", "COMPONENT", "TEST_CASE", "API_ROUTE", "API_ENDPOINT", "MODEL"],
|
|
138
173
|
/**
|
|
139
174
|
* Kotlin states which supertype is the superclass — invoked as `Base()`,
|
|
140
175
|
* which an interface can't be — so `INHERITS`/`IMPLEMENTS` split cleanly
|
|
141
176
|
* from source, unlike Swift's. Decided against the declaration table,
|
|
142
177
|
* syntax only as confirmation.
|
|
143
178
|
*/
|
|
144
|
-
edgeTypes: ["IMPORTS", "CALLS", "TESTS", "IMPLEMENTS", "INHERITS", "USES_TYPE", "SERVES_API", "USES_API"],
|
|
179
|
+
edgeTypes: ["IMPORTS", "CALLS", "READS", "TESTS", "IMPLEMENTS", "INHERITS", "USES_TYPE", "SERVES_API", "USES_API"],
|
|
145
180
|
hasCallHierarchy: false,
|
|
146
181
|
hasTypeHierarchy: false,
|
|
147
182
|
/**
|
|
@@ -153,13 +188,29 @@ export function createKotlinAdapter(options = {}) {
|
|
|
153
188
|
*/
|
|
154
189
|
noiseDirectories: ["build", "target"],
|
|
155
190
|
// Routes: Ktor DSL, Spring MVC/WebFlux annotations. Calls: Ktor client,
|
|
156
|
-
// Retrofit interfaces.
|
|
157
|
-
|
|
191
|
+
// Retrofit interfaces. ORM: JPA/Hibernate and Spring Data MongoDB
|
|
192
|
+
// mappings, the same declarations `adapter-java` reads, which is what
|
|
193
|
+
// carries this adapter's one R3 fact kind. `compose` is Jetpack
|
|
194
|
+
// Compose's COMPONENT reader; three lanes wrote this list in one
|
|
195
|
+
// session and it is their union.
|
|
196
|
+
frameworkExtractors: ["ktor", "ktor-client", "spring", "retrofit", "jpa", "spring-data-mongodb", "compose"],
|
|
158
197
|
// `route-handler-extractor`: Ktor's handler is the registration's
|
|
159
198
|
// trailing lambda, which names no function — the serving function is
|
|
160
199
|
// the single in-repository call inside it. Every other shape (zero
|
|
161
200
|
// calls, several, no lambda) is disclosed rather than guessed.
|
|
162
|
-
|
|
201
|
+
// `client-base-extractor` (DEC-164): declared because it is emitted —
|
|
202
|
+
// a ktor `defaultRequest { url(base) }` this reader can see composes
|
|
203
|
+
// per DEC-097 with the origin stripped, and every caller whose
|
|
204
|
+
// client's construction it saw carries `attrs.clientBase`.
|
|
205
|
+
// `orm-extractor` is `jpa.ts`'s. Three lanes wrote this array in one
|
|
206
|
+
// session; it is their union, not a choice between them.
|
|
207
|
+
frameworkCapabilities: [
|
|
208
|
+
"route-extractor",
|
|
209
|
+
"orm-extractor",
|
|
210
|
+
"client-call-extractor",
|
|
211
|
+
"client-base-extractor",
|
|
212
|
+
"route-handler-extractor",
|
|
213
|
+
],
|
|
163
214
|
};
|
|
164
215
|
},
|
|
165
216
|
async prepare(ctx) {
|
|
@@ -233,8 +284,15 @@ export function createKotlinAdapter(options = {}) {
|
|
|
233
284
|
}
|
|
234
285
|
units.push({ ...parsed, identityPackage: identityPackage(anchor, parsed.packageName, "(default)") });
|
|
235
286
|
}
|
|
236
|
-
|
|
237
|
-
|
|
287
|
+
/**
|
|
288
|
+
* The level this repository actually reached, not the ceiling echoed
|
|
289
|
+
* back. R3 only when some entity in the run carries at least one mapped
|
|
290
|
+
* column whose shape this reader decided — see `shape-reach.ts`.
|
|
291
|
+
*/
|
|
292
|
+
const anchored = units.some((u) => u.identityPackage !== undefined);
|
|
293
|
+
const reach = anchored ? readEntities(units) : undefined;
|
|
294
|
+
const reached = reachedFor(ceiling, anchored, reach);
|
|
295
|
+
session = { root: ctx.root, files, units, reached, reach, failures, unfinished, withoutAnchor, parsedWithErrors };
|
|
238
296
|
return reached;
|
|
239
297
|
},
|
|
240
298
|
async parseFiles(files) {
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAUN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAwB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAkC,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC;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E,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACnE,YAAY,EAAE;oBACZ,GAAG,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;oBAC1F,gFAAgF;oBAChF,GAAG,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAgB,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;iBACvG;gBACD,iBAAiB,EAAE,IAAI,EAAE,OAAO,IAAI,CAAC;gBACrC,KAAK;gBACL,KAAK;gBACL,UAAU;aACX,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,OAAO;YACX,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client-base extractor for Kotlin — DEC-164's contract.
|
|
3
|
+
*
|
|
4
|
+
* Ktor's client has a real base. `defaultRequest { url(API_V1_BASE) }` holds it
|
|
5
|
+
* on the `HttpClient`, and a later `client.get("orders/$id")` resolves against
|
|
6
|
+
* it at run time. So this binding takes C#'s and Java's shape — base on the
|
|
7
|
+
* client object, relative path at the call site — and not the spliced shape
|
|
8
|
+
* `adapter-go`, `adapter-rust` and `adapter-swift` had to use.
|
|
9
|
+
*
|
|
10
|
+
* `client.ts` already refused exactly this call: "an HTTP call whose path is
|
|
11
|
+
* not repository-relative, so no route on this side of the join serves it."
|
|
12
|
+
* True while the base was invisible, and wrong about the call the moment it is
|
|
13
|
+
* not. This is that base, read.
|
|
14
|
+
*
|
|
15
|
+
* ## Three states, and where each one comes from
|
|
16
|
+
*
|
|
17
|
+
* A client whose construction this reader can see and which sets a base earns
|
|
18
|
+
* `resolved` (a string literal, or a `const val` in the same file) or
|
|
19
|
+
* `unresolved` (anything else — `System.getenv`, a config read, an injected
|
|
20
|
+
* value). A client constructed with no base at all — `HttpClient()` — earns
|
|
21
|
+
* `none`, a positive statement. A receiver whose construction this reader
|
|
22
|
+
* never saw earns DEC-164's fourth state, the field's own absence: the reader
|
|
23
|
+
* did not determine a base, which is not the same claim as there being none.
|
|
24
|
+
*
|
|
25
|
+
* ## The trailing slash is load-bearing, and the composition is why
|
|
26
|
+
*
|
|
27
|
+
* Ktor resolves `url(base)` by RFC 3986, so the fixture's base ends in `/`.
|
|
28
|
+
* `prefixOfBaseLiteral` trims it and the call's own relative path is joined
|
|
29
|
+
* under a single separator, so `https://h/api/v1/` + `orders/{param}` is
|
|
30
|
+
* `/api/v1/orders/{param}` however the two were spelled.
|
|
31
|
+
*
|
|
32
|
+
* ## The origin rule, and why it is evidence rather than a guess
|
|
33
|
+
*
|
|
34
|
+
* An absolute URL written at a call site is refused as out-of-scope
|
|
35
|
+
* (DEC-113/DEC-014), because the origin usually names a host this repository
|
|
36
|
+
* does not serve and an endpoint is host-free. That stays, with the one
|
|
37
|
+
* exception `adapter-typescript` and `adapter-python` already adopted: **an
|
|
38
|
+
* origin some base in this same file resolves to is an origin this program
|
|
39
|
+
* treats as its own API.** With no absolute base anywhere the origin set is
|
|
40
|
+
* empty and the rule never fires.
|
|
41
|
+
*
|
|
42
|
+
* The constant table and the origin set are both per FILE — a `const val` in
|
|
43
|
+
* a sibling file stays unresolved, a disclosed recall gap and never a
|
|
44
|
+
* precision one (rule 2).
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* DEC-164's contract, minus its fourth state — the field's own absence from
|
|
48
|
+
* `attrs`, which is a fact about the adapter rather than a value this type
|
|
49
|
+
* can hold.
|
|
50
|
+
*/
|
|
51
|
+
export type ClientBaseResult = {
|
|
52
|
+
/** A base traced to a literal. `path` is DEC-097's kept prefix, origin already stripped. */
|
|
53
|
+
readonly state: "resolved";
|
|
54
|
+
readonly path: string;
|
|
55
|
+
}
|
|
56
|
+
/** No base-setting mechanism in play. A positive statement, not a default. */
|
|
57
|
+
| {
|
|
58
|
+
readonly state: "none";
|
|
59
|
+
} | {
|
|
60
|
+
/** A base was configured and its value is not a literal this reader can evaluate. */
|
|
61
|
+
readonly state: "unresolved";
|
|
62
|
+
readonly why: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* DEC-097: the origin — scheme, host, port — is removed and the path prefix
|
|
66
|
+
* kept. `undefined` when the value is not an absolute URI this reader can
|
|
67
|
+
* split, which is refused rather than guessed at.
|
|
68
|
+
*
|
|
69
|
+
* Shared verbatim with every other adapter that reads a base so they cannot
|
|
70
|
+
* drift; another spelling of 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 KotlinBaseSite = {
|
|
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 `const val` 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: KotlinBaseSite, constants: ReadonlyMap<string, string>): {
|
|
111
|
+
readonly base: ClientBaseResult;
|
|
112
|
+
readonly origin?: string;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=client-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-base.d.ts","sourceRoot":"","sources":["../src/client-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAIH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IACE,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AACH,8EAA8E;GAC5E;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1B;IACE,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,CAAC;AAIN;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK5D;AAED,kFAAkF;AAClF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrE;AAGD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GACtB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9B;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,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 Kotlin — DEC-164's contract.
|
|
3
|
+
*
|
|
4
|
+
* Ktor's client has a real base. `defaultRequest { url(API_V1_BASE) }` holds it
|
|
5
|
+
* on the `HttpClient`, and a later `client.get("orders/$id")` resolves against
|
|
6
|
+
* it at run time. So this binding takes C#'s and Java's shape — base on the
|
|
7
|
+
* client object, relative path at the call site — and not the spliced shape
|
|
8
|
+
* `adapter-go`, `adapter-rust` and `adapter-swift` had to use.
|
|
9
|
+
*
|
|
10
|
+
* `client.ts` already refused exactly this call: "an HTTP call whose path is
|
|
11
|
+
* not repository-relative, so no route on this side of the join serves it."
|
|
12
|
+
* True while the base was invisible, and wrong about the call the moment it is
|
|
13
|
+
* not. This is that base, read.
|
|
14
|
+
*
|
|
15
|
+
* ## Three states, and where each one comes from
|
|
16
|
+
*
|
|
17
|
+
* A client whose construction this reader can see and which sets a base earns
|
|
18
|
+
* `resolved` (a string literal, or a `const val` in the same file) or
|
|
19
|
+
* `unresolved` (anything else — `System.getenv`, a config read, an injected
|
|
20
|
+
* value). A client constructed with no base at all — `HttpClient()` — earns
|
|
21
|
+
* `none`, a positive statement. A receiver whose construction this reader
|
|
22
|
+
* never saw earns DEC-164's fourth state, the field's own absence: the reader
|
|
23
|
+
* did not determine a base, which is not the same claim as there being none.
|
|
24
|
+
*
|
|
25
|
+
* ## The trailing slash is load-bearing, and the composition is why
|
|
26
|
+
*
|
|
27
|
+
* Ktor resolves `url(base)` by RFC 3986, so the fixture's base ends in `/`.
|
|
28
|
+
* `prefixOfBaseLiteral` trims it and the call's own relative path is joined
|
|
29
|
+
* under a single separator, so `https://h/api/v1/` + `orders/{param}` is
|
|
30
|
+
* `/api/v1/orders/{param}` however the two were spelled.
|
|
31
|
+
*
|
|
32
|
+
* ## The origin rule, and why it is evidence rather than a guess
|
|
33
|
+
*
|
|
34
|
+
* An absolute URL written at a call site is refused as out-of-scope
|
|
35
|
+
* (DEC-113/DEC-014), because the origin usually names a host this repository
|
|
36
|
+
* does not serve and an endpoint is host-free. That stays, with the one
|
|
37
|
+
* exception `adapter-typescript` and `adapter-python` already adopted: **an
|
|
38
|
+
* origin some base in this same file resolves to is an origin this program
|
|
39
|
+
* treats as its own API.** With no absolute base anywhere the origin set is
|
|
40
|
+
* empty and the rule never fires.
|
|
41
|
+
*
|
|
42
|
+
* The constant table and the origin set are both per FILE — a `const val` in
|
|
43
|
+
* a sibling file stays unresolved, a disclosed recall gap and never a
|
|
44
|
+
* precision one (rule 2).
|
|
45
|
+
*/
|
|
46
|
+
const ABSOLUTE = /^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/?#]*)(\/[^?#]*)?/;
|
|
47
|
+
/**
|
|
48
|
+
* DEC-097: the origin — scheme, host, port — is removed and the path prefix
|
|
49
|
+
* kept. `undefined` when the value is not an absolute URI this reader can
|
|
50
|
+
* split, which is refused rather than guessed at.
|
|
51
|
+
*
|
|
52
|
+
* Shared verbatim with every other adapter that reads a base so they cannot
|
|
53
|
+
* drift; another spelling of 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 `const val` 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":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAuBH,MAAM,QAAQ,GAAG,mDAAmD,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5B,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,QAAQ,C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AE,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
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
*/
|
|
42
42
|
import type { Node } from "@descryy/adapter-treesitter";
|
|
43
43
|
import type { KotlinImport } from "./parse.ts";
|
|
44
|
+
import { type ClientBaseResult } from "./client-base.ts";
|
|
45
|
+
export type { ClientBaseResult };
|
|
46
|
+
/** The origin set before any base has been read. Named so a caller cannot pass `new Set()` by accident and mean something else. */
|
|
47
|
+
export declare const NO_KNOWN_ORIGINS: ReadonlySet<string>;
|
|
44
48
|
export interface KotlinClientCall {
|
|
45
49
|
readonly method: string;
|
|
46
50
|
/** The path with every interpolation collapsed to `{param}`. */
|
|
@@ -50,6 +54,14 @@ export interface KotlinClientCall {
|
|
|
50
54
|
/** `client.get` — what the call site wrote. */
|
|
51
55
|
readonly client: string;
|
|
52
56
|
readonly line: number;
|
|
57
|
+
/**
|
|
58
|
+
* DEC-164's contract — see `client-base.ts`. `undefined` is the fourth
|
|
59
|
+
* state: this reader never saw the receiver's construction, so it did not
|
|
60
|
+
* determine a base, which is not the same claim as there being none.
|
|
61
|
+
*/
|
|
62
|
+
readonly clientBase?: ClientBaseResult;
|
|
63
|
+
/** The origin a *resolved* base was written at, before DEC-097 stripped it. Never folded back into `path`. */
|
|
64
|
+
readonly baseOrigin?: string;
|
|
53
65
|
}
|
|
54
66
|
export interface KotlinClientRefusal {
|
|
55
67
|
readonly rawTarget: string;
|
|
@@ -64,6 +76,14 @@ export interface KotlinClientRefusal {
|
|
|
64
76
|
* Present only on the generic fallthrough of `diagnoseArgument`.
|
|
65
77
|
*/
|
|
66
78
|
readonly argumentKind?: "field" | "call" | "concatenation" | "other";
|
|
79
|
+
/** DEC-164's state, when this reader reached one. See `client-base.ts`. */
|
|
80
|
+
readonly clientBase?: ClientBaseResult;
|
|
81
|
+
/**
|
|
82
|
+
* The call's OWN path, with the unreadable base left off — golden 08b's
|
|
83
|
+
* requirement that a refusal name both halves. Without it the row says a
|
|
84
|
+
* base was unreadable and cannot say which call site it belonged to.
|
|
85
|
+
*/
|
|
86
|
+
readonly callPath?: string;
|
|
67
87
|
}
|
|
68
88
|
export type BaseRefusalClass = "value-unknown" | "varies-per-call" | "capability-gap";
|
|
69
89
|
export interface KotlinClientCalls {
|
|
@@ -71,5 +91,7 @@ export interface KotlinClientCalls {
|
|
|
71
91
|
readonly refusals: readonly KotlinClientRefusal[];
|
|
72
92
|
}
|
|
73
93
|
/** Every HTTP call written in one file, and every one refused. */
|
|
74
|
-
export declare function readKtorClientCalls(root: Node, imports: readonly KotlinImport[]
|
|
94
|
+
export declare function readKtorClientCalls(root: Node, imports: readonly KotlinImport[],
|
|
95
|
+
/** Origins some base in this same file already resolves to — see `client-base.ts`'s header. */
|
|
96
|
+
knownOrigins?: ReadonlySet<string>): KotlinClientCalls;
|
|
75
97
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.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