carrick 0.3.161 → 0.3.163
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/contract.d.ts +8 -0
- package/dist/contract.js.map +1 -1
- package/dist/facts/store.d.ts +12 -0
- package/dist/facts/store.js +15 -0
- package/dist/facts/store.js.map +1 -1
- package/dist/held/daemon.d.ts +8 -0
- package/dist/held/daemon.js.map +1 -1
- package/dist/held/early.d.ts +1 -1
- package/dist/held/early.js +89 -11
- package/dist/held/early.js.map +1 -1
- package/dist/held/message-rows.d.ts +3 -0
- package/dist/held/message-rows.js +41 -0
- package/dist/held/message-rows.js.map +1 -0
- package/dist/held/place.d.ts +11 -2
- package/dist/held/place.js +4 -1
- package/dist/held/place.js.map +1 -1
- package/dist/held/runtime.d.ts +1 -1
- package/dist/held/runtime.js +75 -17
- package/dist/held/runtime.js.map +1 -1
- package/dist/held/shadow.d.ts +2 -0
- package/dist/held/shadow.js.map +1 -1
- package/dist/hook/confirm.js +40 -21
- package/dist/hook/confirm.js.map +1 -1
- package/dist/init/codex.d.ts +1 -1
- package/dist/init/codex.js +8 -4
- package/dist/init/codex.js.map +1 -1
- package/dist/init/doctor.d.ts +10 -13
- package/dist/init/doctor.js +26 -92
- package/dist/init/doctor.js.map +1 -1
- package/dist/init/launcher.d.ts +35 -0
- package/dist/init/launcher.js +85 -0
- package/dist/init/launcher.js.map +1 -0
- package/dist/init/outdated.d.ts +3 -4
- package/dist/init/outdated.js +19 -8
- package/dist/init/outdated.js.map +1 -1
- package/dist/init/remove.js +4 -0
- package/dist/init/remove.js.map +1 -1
- package/dist/init/repo-copies.d.ts +1 -1
- package/dist/init/repo-copies.js +13 -4
- package/dist/init/repo-copies.js.map +1 -1
- package/dist/init/run.js +17 -26
- package/dist/init/run.js.map +1 -1
- package/dist/init/self-update.js +7 -4
- package/dist/init/self-update.js.map +1 -1
- package/dist/init/settings.d.ts +0 -34
- package/dist/init/settings.js +11 -45
- package/dist/init/settings.js.map +1 -1
- package/dist/init/task-skills.d.ts +1 -1
- package/dist/init/task-skills.js +1 -0
- package/dist/init/task-skills.js.map +1 -1
- package/dist/render.d.ts +6 -0
- package/dist/render.js +27 -7
- package/dist/render.js.map +1 -1
- package/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/carrick-hook.sh +122 -0
- package/plugin/hooks/hooks.json +8 -8
- package/sidecar/dist/src/capture/anchors.d.ts +2 -2
- package/sidecar/dist/src/capture/anchors.js +25 -10
- package/sidecar/dist/src/capture/api.d.ts +10 -0
- package/sidecar/dist/src/capture/check-classify.d.ts +11 -4
- package/sidecar/dist/src/capture/check-classify.js +65 -25
- package/sidecar/dist/src/capture/check-fields.d.ts +2 -1
- package/sidecar/dist/src/capture/check-fields.js +10 -2
- package/sidecar/dist/src/capture/check-probe.d.ts +82 -25
- package/sidecar/dist/src/capture/check-probe.js +106 -37
- package/sidecar/dist/src/capture/index.d.ts +3 -2
- package/sidecar/dist/src/capture/index.js +14 -2
- package/sidecar/dist/src/capture/reply-status.d.ts +86 -0
- package/sidecar/dist/src/capture/reply-status.js +255 -0
- package/sidecar/dist/src/capture/site-node.d.ts +34 -0
- package/sidecar/dist/src/capture/site-node.js +258 -0
- package/sidecar/dist/src/engine-stamp.json +1 -1
- package/sidecar/dist/src/held-shadow.d.ts +23 -2
- package/sidecar/dist/src/held-shadow.js +42 -8
- package/sidecar/dist/src/stated-params.d.ts +3 -2
- package/sidecar/dist/src/type-inferrer.d.ts +91 -55
- package/sidecar/dist/src/type-inferrer.js +350 -218
- package/sidecar/dist/src/types.d.ts +10 -0
- package/sidecar/dist/src/validators.d.ts +150 -28
- package/sidecar/dist/src/validators.js +15 -1
- package/templates/carrick-hook.sh +122 -0
- package/templates/skills/carrick-audit.md +97 -0
- package/templates/skills/carrick-census.md +73 -87
|
@@ -270,21 +270,6 @@ export function classifyPair(input) {
|
|
|
270
270
|
...notAFact(wireFormUnknownReason(side)),
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
// 4c''. A GraphQL root record that lacks fields the served schema declares
|
|
274
|
-
// (carrick#1875): the wire line fails, and passes once every such
|
|
275
|
-
// field is filled, so the verdict hangs on field resolvers the check
|
|
276
|
-
// does not read. Not a fact either way, and no side to retype: a
|
|
277
|
-
// retype would read the same record.
|
|
278
|
-
if (firedGates.has('sent:field_resolver')) {
|
|
279
|
-
const { side } = sideForGate('sent:field_resolver', plan);
|
|
280
|
-
return {
|
|
281
|
-
...base,
|
|
282
|
-
bucket: 'unverifiable',
|
|
283
|
-
gate: `${side}:field_resolver`,
|
|
284
|
-
diagnostic: `${graphqlFieldResolverReason()}.`,
|
|
285
|
-
...notAFact(graphqlFieldResolverReason()),
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
273
|
// 4d. A body read as raw text (carrick#1842): a `.text()` read, or a request
|
|
289
274
|
// library's text format, takes the body unparsed, so `string` there
|
|
290
275
|
// states no structural contract. Like bytes, the pair is not compared,
|
|
@@ -334,7 +319,47 @@ export function classifyPair(input) {
|
|
|
334
319
|
// disagree only over what serialisation changes (a producer `Date` read as
|
|
335
320
|
// the `string` it becomes) has no error on this line and is not a drift.
|
|
336
321
|
const decisiveLine = decisiveAssignmentLine(plan);
|
|
337
|
-
|
|
322
|
+
let assignDiag = probeDiags.find((d) => d.line === decisiveLine && ASSIGNMENT_CODES.has(d.code));
|
|
323
|
+
// 5'. A GraphQL wire line that fails is read once more (carrick#4726): with
|
|
324
|
+
// the fields the root record lacks or converts in the type the served
|
|
325
|
+
// schema declares. That line decides. Any other diagnostic from the wire
|
|
326
|
+
// alias down to it (a type too deep to instantiate makes its alias an
|
|
327
|
+
// error type that assigns to anything, and the fill is built on the
|
|
328
|
+
// wire type) means the fill was never judged: unverifiable, never
|
|
329
|
+
// compatible.
|
|
330
|
+
let declaredCleared = false;
|
|
331
|
+
if (assignDiag && plan.declaredAssignmentLine !== undefined) {
|
|
332
|
+
const from = plan.assignmentLine + 1;
|
|
333
|
+
const to = plan.declaredAssignmentLine;
|
|
334
|
+
const last = plan.declaredReadLine ?? to;
|
|
335
|
+
const unjudged = probeDiags.find((d) => d.line >= from && d.line <= last && !ASSIGNMENT_CODES.has(d.code));
|
|
336
|
+
if (unjudged) {
|
|
337
|
+
return {
|
|
338
|
+
...base,
|
|
339
|
+
bucket: 'unverifiable',
|
|
340
|
+
gate: 'assignment:other',
|
|
341
|
+
diagnostic: scrubDiagnostic(unjudged.message, scrubCtx, plan.sentEndpoint.alias, plan.expectedEndpoint.alias),
|
|
342
|
+
...notAFact('the probe raised a diagnostic that is not an assignment mismatch'),
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
assignDiag = probeDiags.find((d) => d.line === to && ASSIGNMENT_CODES.has(d.code));
|
|
346
|
+
// It passed, but only through a key the table could not answer (a
|
|
347
|
+
// fragment on a union or interface member, an alias): the read line,
|
|
348
|
+
// where such a key assigns to nothing, fails. Not a fact either way.
|
|
349
|
+
const unread = assignDiag === undefined &&
|
|
350
|
+
plan.declaredReadLine !== undefined &&
|
|
351
|
+
probeDiags.some((d) => d.line === plan.declaredReadLine && ASSIGNMENT_CODES.has(d.code));
|
|
352
|
+
if (unread) {
|
|
353
|
+
return {
|
|
354
|
+
...base,
|
|
355
|
+
bucket: 'unverifiable',
|
|
356
|
+
gate: 'producer:undeclared_selection',
|
|
357
|
+
diagnostic: `${GRAPHQL_UNDECLARED_SELECTION_REASON}.`,
|
|
358
|
+
...notAFact(GRAPHQL_UNDECLARED_SELECTION_REASON),
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
declaredCleared = assignDiag === undefined;
|
|
362
|
+
}
|
|
338
363
|
// 5a. Unless the mismatch is a sent union the expected type takes in part,
|
|
339
364
|
// the members it rejects sharing no field with a type whose every field
|
|
340
365
|
// is optional (carrick#1995). That is a route answering a body per
|
|
@@ -408,7 +433,10 @@ export function classifyPair(input) {
|
|
|
408
433
|
: probeDiags.find((d) => d.line === plan.wireAssignmentLine && !ASSIGNMENT_CODES.has(d.code));
|
|
409
434
|
if (wireOther) {
|
|
410
435
|
const declaredMismatch = probeDiags.find((d) => d.line === plan.assignmentLine && ASSIGNMENT_CODES.has(d.code));
|
|
411
|
-
|
|
436
|
+
// Not for a GraphQL probe with a declared block (carrick#4726): its first
|
|
437
|
+
// line compares the root record alone, which misses every field a field
|
|
438
|
+
// resolver supplies, so a mismatch there is no judgment of the pair.
|
|
439
|
+
if (declaredMismatch && plan.declaredAssignmentLine === undefined) {
|
|
412
440
|
return {
|
|
413
441
|
...base,
|
|
414
442
|
bucket: 'incompatible',
|
|
@@ -427,8 +455,13 @@ export function classifyPair(input) {
|
|
|
427
455
|
...notAFact('the probe raised a diagnostic that is not an assignment mismatch'),
|
|
428
456
|
};
|
|
429
457
|
}
|
|
430
|
-
// 6. No diagnostics -> compatible.
|
|
431
|
-
return {
|
|
458
|
+
// 6. No diagnostics -> compatible. A pair the declared line cleared says so.
|
|
459
|
+
return {
|
|
460
|
+
...base,
|
|
461
|
+
bucket: 'compatible',
|
|
462
|
+
...(declaredCleared ? { notes: [...base.notes, GRAPHQL_DECLARED_FIELDS_NOTE] } : {}),
|
|
463
|
+
...factness(input),
|
|
464
|
+
};
|
|
432
465
|
}
|
|
433
466
|
/**
|
|
434
467
|
* Why a procedure pair whose two wire readings disagree is not compared
|
|
@@ -438,13 +471,20 @@ export function wireFormUnknownReason(side) {
|
|
|
438
471
|
return `the ${side} sends this payload through an RPC router whose transformer decides how a Date travels; the types match in one form and not the other, so Carrick cannot verify them without knowing the transformer`;
|
|
439
472
|
}
|
|
440
473
|
/**
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
474
|
+
* The note on a GraphQL pair the declared line cleared (carrick#4726): the
|
|
475
|
+
* wire line failed on fields the root record lacks or converts, and the pair
|
|
476
|
+
* agrees once they take the type the served schema declares, every key the
|
|
477
|
+
* consumer reads answered by the schema table (the read line passed too).
|
|
444
478
|
*/
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
479
|
+
/**
|
|
480
|
+
* Why a GraphQL pair the declared line passed only through a consumer key the
|
|
481
|
+
* schema table could not answer is not compared (carrick#4726).
|
|
482
|
+
* Customer-facing: it prints after "Types not verified".
|
|
483
|
+
*/
|
|
484
|
+
export const GRAPHQL_UNDECLARED_SELECTION_REASON = "the consumer reads a field that the schema type does not declare and the root resolver's record lacks, " +
|
|
485
|
+
'such as an alias or a fragment on a union or interface member; Carrick does not read field resolvers';
|
|
486
|
+
export const GRAPHQL_DECLARED_FIELDS_NOTE = "fields the root resolver's record lacks or converts were compared in the type the served schema declares; " +
|
|
487
|
+
'Carrick did not read their field resolvers';
|
|
448
488
|
/**
|
|
449
489
|
* The note on a request the consumer's unwidened reading cleared
|
|
450
490
|
* (carrick#2011).
|
|
@@ -90,7 +90,8 @@ export declare const MAX_NAMED_FIELDS = 8;
|
|
|
90
90
|
*
|
|
91
91
|
* The sent side is whatever that assignment actually sent: the GraphQL
|
|
92
92
|
* comparand where one exists, then the JSON wire form where serialising
|
|
93
|
-
* changes the type
|
|
93
|
+
* changes the type, then the GraphQL declared fill where the wire form does
|
|
94
|
+
* not assign. Reading `sent` there instead would describe a type the
|
|
94
95
|
* judge did not compare, which is the one way a reader of this pair could
|
|
95
96
|
* contradict it.
|
|
96
97
|
*/
|
|
@@ -64,7 +64,8 @@ function assignabilityOf(checker) {
|
|
|
64
64
|
*
|
|
65
65
|
* The sent side is whatever that assignment actually sent: the GraphQL
|
|
66
66
|
* comparand where one exists, then the JSON wire form where serialising
|
|
67
|
-
* changes the type
|
|
67
|
+
* changes the type, then the GraphQL declared fill where the wire form does
|
|
68
|
+
* not assign. Reading `sent` there instead would describe a type the
|
|
68
69
|
* judge did not compare, which is the one way a reader of this pair could
|
|
69
70
|
* contradict it.
|
|
70
71
|
*/
|
|
@@ -97,8 +98,15 @@ export function comparedTypes(opened, plan) {
|
|
|
97
98
|
// optionality gap or the wire note (carrick#1341). Where serialisation did
|
|
98
99
|
// change the type the wire form is a mapped type with real members, and it
|
|
99
100
|
// stays the thing compared, because that is what the judge judged.
|
|
101
|
+
const sentForm = wireApplied ? wire.type : declared.type;
|
|
102
|
+
// A GraphQL wire form that does not assign is decided by the declared line
|
|
103
|
+
// (carrick#4726): the wire type with the fields the root record lacks or
|
|
104
|
+
// converts in the type the served schema declares. That is what the judge
|
|
105
|
+
// compared, so the report reads it, and never calls a filled field missing.
|
|
106
|
+
const filled = declaredConstType(source, checker, 'sentDeclared');
|
|
107
|
+
const compared = filled !== undefined && !isAssignableTo(sentForm, expected.type) ? filled.type : sentForm;
|
|
100
108
|
return {
|
|
101
|
-
compared
|
|
109
|
+
compared,
|
|
102
110
|
expected,
|
|
103
111
|
wireApplied,
|
|
104
112
|
checker,
|
|
@@ -79,7 +79,7 @@ export declare function fnv1a(input: string): string;
|
|
|
79
79
|
* path, so it is byte-stable across runs. */
|
|
80
80
|
export declare function pairId(spec: CheckPairSpec): string;
|
|
81
81
|
/** Names each gate line so a TS2344 can be attributed to a specific side+kind. */
|
|
82
|
-
export type GateName = 'sent:any' | 'sent:unknown' | 'sent:never' | 'sent:void' | 'sent:form' | 'sent:bytes' | 'sent:wire_form' | '
|
|
82
|
+
export type GateName = 'sent:any' | 'sent:unknown' | 'sent:never' | 'sent:void' | 'sent:form' | 'sent:bytes' | 'sent:wire_form' | 'expected:any' | 'expected:unknown' | 'expected:never' | 'expected:void' | 'expected:bytes' | 'sent:envelope' | 'expected:envelope';
|
|
83
83
|
export interface ProbePlan {
|
|
84
84
|
pairId: string;
|
|
85
85
|
spec: CheckPairSpec;
|
|
@@ -121,6 +121,23 @@ export interface ProbePlan {
|
|
|
121
121
|
* sends with no literal widened.
|
|
122
122
|
*/
|
|
123
123
|
unwidenedFromLine?: number;
|
|
124
|
+
/**
|
|
125
|
+
* The GraphQL declared block (carrick#4726), present on a scalar-form probe
|
|
126
|
+
* only: its first line, after the wire line, and its assignment, which sends
|
|
127
|
+
* the wire type with the fields the root record lacks or converts in the
|
|
128
|
+
* type the served schema declares. When the wire line fails this line
|
|
129
|
+
* decides; any other diagnostic from the line after `assignmentLine` (the
|
|
130
|
+
* wire alias the fill is built on) to it means the fill was never judged.
|
|
131
|
+
*/
|
|
132
|
+
declaredFromLine?: number;
|
|
133
|
+
declaredAssignmentLine?: number;
|
|
134
|
+
/**
|
|
135
|
+
* The same assignment with every consumer key the table could not answer
|
|
136
|
+
* (one the schema type does not declare: a fragment on a union member or an
|
|
137
|
+
* interface implementation, an alias) as a type that assigns to nothing.
|
|
138
|
+
* It fails where the declared line passed only through such a key.
|
|
139
|
+
*/
|
|
140
|
+
declaredReadLine?: number;
|
|
124
141
|
}
|
|
125
142
|
/**
|
|
126
143
|
* The surface export that carries a response alias's unwidened reading
|
|
@@ -180,6 +197,20 @@ export declare function voidReceiverDeclaration(prefix: string): string;
|
|
|
180
197
|
* `absent_body_tolerated`).
|
|
181
198
|
*/
|
|
182
199
|
export declare function absentBodyRule(sent: string, expected: string, toleratesAbsence: boolean): string;
|
|
200
|
+
/**
|
|
201
|
+
* The top and bottom type tests the probe's six gates read: `IsAny<T>`,
|
|
202
|
+
* `IsUnknown<T>` (`any` excluded first) and `IsNever<T>`. `prefix` namespaces
|
|
203
|
+
* the names, as for `jsonWireDeclarations`; `buildProbe` writes them with
|
|
204
|
+
* none. A held check that must stay silent on a top or bottom side reads them
|
|
205
|
+
* from here, never from a copy.
|
|
206
|
+
*/
|
|
207
|
+
export declare function topTypeDeclarations(prefix: string): string[];
|
|
208
|
+
/**
|
|
209
|
+
* Whether the absent-body tolerance (`absentBodyRule`) reads a pair: the
|
|
210
|
+
* request direction of HTTP, and socket and pub/sub payloads (the subscriber
|
|
211
|
+
* is `expected`). Never an HTTP response, and not a GraphQL request.
|
|
212
|
+
*/
|
|
213
|
+
export declare function absentBodyApplies(protocol: ProbeProtocol, typeKind: ProbeTypeKind): boolean;
|
|
183
214
|
/**
|
|
184
215
|
* The judge's three tolerances, as the texts the probe is built from: the
|
|
185
216
|
* literal-widened reading (`unwidened_alias_suffix`, the export suffix a stub
|
|
@@ -250,35 +281,61 @@ export declare function graphqlComparandLeafRule(sent: string, expected: string,
|
|
|
250
281
|
/** The scalar form's wire line over the comparand (carrick#4403): each leaf as its scalar sends it. */
|
|
251
282
|
export declare function graphqlScalarWireRule(comparand: string, relaxed: string, leaf: string, prefix: string): string;
|
|
252
283
|
/**
|
|
253
|
-
* The
|
|
254
|
-
* `<p>
|
|
255
|
-
* `<p>
|
|
256
|
-
*
|
|
284
|
+
* The declared fill's helpers (carrick#1875 option 1, carrick#4726), namespaced
|
|
285
|
+
* by `prefix`. They read `<p>GqlTypes`, `<p>GqlScalarSent`, `<p>GqlFieldOf`,
|
|
286
|
+
* `<p>GqlDepth` and `<p>GqlNames`, so they follow the leaf walk's lines.
|
|
287
|
+
*
|
|
288
|
+
* A root resolver's record often lacks fields the schema declares (relations,
|
|
289
|
+
* computed fields), or holds one as a generic JSON value or a primitive where
|
|
290
|
+
* the schema declares an object type. Field resolvers the check does not read
|
|
291
|
+
* supply or convert them. `GqlSdlFilled<C, F, E>` is the record `C` (declared
|
|
292
|
+
* as `F`) with each such field replaced by `GqlSdlDeclared`, the type the
|
|
293
|
+
* schema declares for it, read over the consumer's own reading `E`:
|
|
257
294
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
295
|
+
* - non-null strips `null`, a nullable field adds `| null`, a list maps its
|
|
296
|
+
* elements;
|
|
297
|
+
* - a built-in scalar is the type it sends (`GqlScalarSent`); a custom
|
|
298
|
+
* scalar and a type the table does not hold are `any`, since the table
|
|
299
|
+
* holds no scalar's wire form. An enum is a string on the wire whose values
|
|
300
|
+
* the table does not hold (carrick#4747): where the consumer's reading can
|
|
301
|
+
* hold a string (`GqlStringy`: `string`, a literal or union with one, a
|
|
302
|
+
* template literal, a string enum, `any`/`unknown`, null ignored) it states
|
|
303
|
+
* no constraint (`any`);
|
|
304
|
+
* where it can never hold one (`number`, `boolean`, an object, an array, a
|
|
305
|
+
* numeric enum) the field is `string`, so the pair breaks. A literal union
|
|
306
|
+
* that misses a value is not told apart until the table carries values;
|
|
307
|
+
* - an object type maps each consumer key the schema type declares to its
|
|
308
|
+
* declared type. A key it does not declare (a union member's or an
|
|
309
|
+
* interface implementation's field read through a fragment, an alias) is
|
|
310
|
+
* `U`: `any` on the declared line, `GqlUnread` on the read line, so a pair
|
|
311
|
+
* that passes only through such a key is told apart from one the table
|
|
312
|
+
* answered. `__typename` is supplied by the server and is `any`. Whether a
|
|
313
|
+
* selection is declared at all is the selection reader's question
|
|
314
|
+
* (carrick#3201). A consumer that reads the field as a non-object gets
|
|
315
|
+
* `{}`, which assigns to no primitive and no array;
|
|
316
|
+
* - the depth bound gives `any`, and so does a field the consumer does not
|
|
317
|
+
* read, which it never compares.
|
|
263
318
|
*
|
|
264
|
-
* Rule G: a field the record HAS is
|
|
265
|
-
* object type (or a list of them, at any depth) and the
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
319
|
+
* Rule G decides conversion: a field the record HAS is converted when the
|
|
320
|
+
* schema types it as an object type (or a list of them, at any depth) and the
|
|
321
|
+
* record's own type for it is a primitive or a generic JSON value. The JSON
|
|
322
|
+
* value is read by its structure, on the whole field before any union splits:
|
|
323
|
+
* it holds every JSON primitive, and an array of itself and a string-keyed
|
|
324
|
+
* object of itself both assign to it. A field that is, or includes, an object
|
|
325
|
+
* shape is compared field by field. The root record is never a field, so it
|
|
326
|
+
* is never replaced whole. No branch yields `never`.
|
|
272
327
|
*/
|
|
273
|
-
export declare function
|
|
328
|
+
export declare function graphqlDeclaredDeclarations(prefix: string): string[];
|
|
274
329
|
/**
|
|
275
|
-
* The
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* the
|
|
330
|
+
* The declared line's sent type (carrick#4726): the scalar form's wire type
|
|
331
|
+
* whenever that already assigns, else the wire type with the fields the
|
|
332
|
+
* record lacks or converts in the type the schema declares
|
|
333
|
+
* (`graphqlDeclaredDeclarations`). The short-circuit keeps every pair the wire
|
|
334
|
+
* line passes exactly as it was. `wire` is the scalar form's wire type,
|
|
335
|
+
* `relaxed` the consumer's reading, `leaf` the comparand's SDL leaf. The probe
|
|
336
|
+
* and the held check write this one text.
|
|
280
337
|
*/
|
|
281
|
-
export declare function
|
|
338
|
+
export declare function graphqlDeclaredRule(wire: string, relaxed: string, leaf: string, prefix: string, unread?: 'any' | 'unread'): string;
|
|
282
339
|
export declare function decisiveAssignmentLine(plan: ProbePlan): number;
|
|
283
340
|
/**
|
|
284
341
|
* Build one probe, recording the exact line of every gate and the assignment so
|
|
@@ -191,6 +191,28 @@ export function absentBodyRule(sent, expected, toleratesAbsence) {
|
|
|
191
191
|
const byHandler = toleratesAbsence ? dropped : sent;
|
|
192
192
|
return `[Extract<${sent}, undefined | void>] extends [never] ? ${sent} : [{}] extends [${expected}] ? ([Extract<${expected}, undefined | void>] extends [never] ? ${byHandler} : ${dropped}) : ${sent}`;
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* The top and bottom type tests the probe's six gates read: `IsAny<T>`,
|
|
196
|
+
* `IsUnknown<T>` (`any` excluded first) and `IsNever<T>`. `prefix` namespaces
|
|
197
|
+
* the names, as for `jsonWireDeclarations`; `buildProbe` writes them with
|
|
198
|
+
* none. A held check that must stay silent on a top or bottom side reads them
|
|
199
|
+
* from here, never from a copy.
|
|
200
|
+
*/
|
|
201
|
+
export function topTypeDeclarations(prefix) {
|
|
202
|
+
return [
|
|
203
|
+
`type ${prefix}IsAny<T> = 0 extends 1 & T ? true : false;`,
|
|
204
|
+
`type ${prefix}IsUnknown<T> = unknown extends T ? (0 extends 1 & T ? false : true) : false;`,
|
|
205
|
+
`type ${prefix}IsNever<T> = [T] extends [never] ? true : false;`,
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Whether the absent-body tolerance (`absentBodyRule`) reads a pair: the
|
|
210
|
+
* request direction of HTTP, and socket and pub/sub payloads (the subscriber
|
|
211
|
+
* is `expected`). Never an HTTP response, and not a GraphQL request.
|
|
212
|
+
*/
|
|
213
|
+
export function absentBodyApplies(protocol, typeKind) {
|
|
214
|
+
return (protocol === 'http' && typeKind === 'request') || protocol === 'socket' || protocol === 'pubsub';
|
|
215
|
+
}
|
|
194
216
|
export function judgeTolerances(prefix) {
|
|
195
217
|
return {
|
|
196
218
|
unwidened_alias_suffix: unwidenedAliasOf(''),
|
|
@@ -300,45 +322,79 @@ export function graphqlScalarWireRule(comparand, relaxed, leaf, prefix) {
|
|
|
300
322
|
return `[${comparand}] extends [${relaxed}] ? ${comparand} : (${p}JsonWireSame<${p}GqlLeafSent<${comparand}, ${leaf}>, ${comparand}> extends true ? ${comparand} : ${p}GqlLeafSent<${comparand}, ${leaf}>)`;
|
|
301
323
|
}
|
|
302
324
|
/**
|
|
303
|
-
* The
|
|
304
|
-
* `<p>
|
|
305
|
-
* `<p>
|
|
306
|
-
*
|
|
325
|
+
* The declared fill's helpers (carrick#1875 option 1, carrick#4726), namespaced
|
|
326
|
+
* by `prefix`. They read `<p>GqlTypes`, `<p>GqlScalarSent`, `<p>GqlFieldOf`,
|
|
327
|
+
* `<p>GqlDepth` and `<p>GqlNames`, so they follow the leaf walk's lines.
|
|
328
|
+
*
|
|
329
|
+
* A root resolver's record often lacks fields the schema declares (relations,
|
|
330
|
+
* computed fields), or holds one as a generic JSON value or a primitive where
|
|
331
|
+
* the schema declares an object type. Field resolvers the check does not read
|
|
332
|
+
* supply or convert them. `GqlSdlFilled<C, F, E>` is the record `C` (declared
|
|
333
|
+
* as `F`) with each such field replaced by `GqlSdlDeclared`, the type the
|
|
334
|
+
* schema declares for it, read over the consumer's own reading `E`:
|
|
307
335
|
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
336
|
+
* - non-null strips `null`, a nullable field adds `| null`, a list maps its
|
|
337
|
+
* elements;
|
|
338
|
+
* - a built-in scalar is the type it sends (`GqlScalarSent`); a custom
|
|
339
|
+
* scalar and a type the table does not hold are `any`, since the table
|
|
340
|
+
* holds no scalar's wire form. An enum is a string on the wire whose values
|
|
341
|
+
* the table does not hold (carrick#4747): where the consumer's reading can
|
|
342
|
+
* hold a string (`GqlStringy`: `string`, a literal or union with one, a
|
|
343
|
+
* template literal, a string enum, `any`/`unknown`, null ignored) it states
|
|
344
|
+
* no constraint (`any`);
|
|
345
|
+
* where it can never hold one (`number`, `boolean`, an object, an array, a
|
|
346
|
+
* numeric enum) the field is `string`, so the pair breaks. A literal union
|
|
347
|
+
* that misses a value is not told apart until the table carries values;
|
|
348
|
+
* - an object type maps each consumer key the schema type declares to its
|
|
349
|
+
* declared type. A key it does not declare (a union member's or an
|
|
350
|
+
* interface implementation's field read through a fragment, an alias) is
|
|
351
|
+
* `U`: `any` on the declared line, `GqlUnread` on the read line, so a pair
|
|
352
|
+
* that passes only through such a key is told apart from one the table
|
|
353
|
+
* answered. `__typename` is supplied by the server and is `any`. Whether a
|
|
354
|
+
* selection is declared at all is the selection reader's question
|
|
355
|
+
* (carrick#3201). A consumer that reads the field as a non-object gets
|
|
356
|
+
* `{}`, which assigns to no primitive and no array;
|
|
357
|
+
* - the depth bound gives `any`, and so does a field the consumer does not
|
|
358
|
+
* read, which it never compares.
|
|
313
359
|
*
|
|
314
|
-
* Rule G: a field the record HAS is
|
|
315
|
-
* object type (or a list of them, at any depth) and the
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
360
|
+
* Rule G decides conversion: a field the record HAS is converted when the
|
|
361
|
+
* schema types it as an object type (or a list of them, at any depth) and the
|
|
362
|
+
* record's own type for it is a primitive or a generic JSON value. The JSON
|
|
363
|
+
* value is read by its structure, on the whole field before any union splits:
|
|
364
|
+
* it holds every JSON primitive, and an array of itself and a string-keyed
|
|
365
|
+
* object of itself both assign to it. A field that is, or includes, an object
|
|
366
|
+
* shape is compared field by field. The root record is never a field, so it
|
|
367
|
+
* is never replaced whole. No branch yields `never`.
|
|
322
368
|
*/
|
|
323
|
-
export function
|
|
369
|
+
export function graphqlDeclaredDeclarations(prefix) {
|
|
324
370
|
const p = prefix;
|
|
325
371
|
return [
|
|
326
372
|
`type ${p}GqlObjectLeaf<F> = [F] extends [{ non_null: infer I }] ? ${p}GqlObjectLeaf<I> : [F] extends [{ list: infer I }] ? ${p}GqlObjectLeaf<I> : [F] extends [{ type: infer T }] ? ([T] extends [keyof ${p}GqlTypes] ? true : false) : false;`,
|
|
327
373
|
`type ${p}GqlJsonValueLike<X> = [string | number | boolean] extends [X] ? ([X[]] extends [X] ? ([{ [k: string]: X }] extends [X] ? true : false) : false) : false;`,
|
|
328
374
|
`type ${p}GqlNotShape<X> = [X] extends [never] ? false : [X] extends [string | number | boolean | bigint] ? true : ${p}GqlJsonValueLike<X>;`,
|
|
329
375
|
`type ${p}GqlConvertedField<C, F> = [unknown] extends [C] ? false : [${p}GqlObjectLeaf<F>] extends [true] ? ${p}GqlNotShape<Exclude<C, null | undefined>> : false;`,
|
|
330
|
-
`type ${p}
|
|
376
|
+
`type ${p}GqlAt<E, K> = E extends object ? (K extends keyof E ? E[K] : never) : never;`,
|
|
377
|
+
`type ${p}GqlElemOf<E> = E extends readonly (infer X)[] ? X : never;`,
|
|
378
|
+
`type ${p}GqlStringy<E> = [E] extends [never] ? true : [unknown] extends [E] ? true : [Extract<NonNullable<E>, string>] extends [never] ? false : true;`,
|
|
379
|
+
`type ${p}GqlUnread = { readonly __carrick_unread: never };`,
|
|
380
|
+
`type ${p}GqlSdlObject<E, T extends keyof ${p}GqlTypes, D extends number, U> = [E] extends [never] ? {} : E extends readonly unknown[] ? {} : E extends (...args: any[]) => any ? {} : E extends object ? { [K in keyof E]: K extends keyof ${p}GqlTypes[T] ? ${p}GqlSdlDeclared<E[K], ${p}GqlFieldOf<T, K>, U, ${p}GqlDepth[D]> : K extends '__typename' ? any : U } : {};`,
|
|
381
|
+
`type ${p}GqlSdlInner<E, F, U, D extends number> = [F] extends [{ list: infer I }] ? ${p}GqlSdlDeclared<${p}GqlElemOf<E>, I, U, ${p}GqlDepth[D]>[] : [F] extends [{ enum: any }] ? ([${p}GqlStringy<E>] extends [true] ? any : string) : [F] extends [{ scalar: infer N }] ? (N extends keyof ${p}GqlScalarSent ? ${p}GqlScalarSent[N] : any) : [F] extends [{ type: infer T }] ? ([T] extends [keyof ${p}GqlTypes] ? ${p}GqlSdlObject<Exclude<E, null | undefined>, T, D, U> : any) : any;`,
|
|
382
|
+
`type ${p}GqlSdlDeclared<E, F, U, D extends number = 15> = [D] extends [never] ? any : [E] extends [never] ? any : [unknown] extends [E] ? E : [F] extends [{ non_null: infer I }] ? ${p}GqlSdlInner<E, I, U, D> : ${p}GqlSdlInner<E, F, U, D> | null;`,
|
|
383
|
+
`type ${p}GqlSdlFilled<C, F, E, U, D extends number = 15> = [D] extends [never] ? C : [unknown] extends [C] ? C : [F] extends [{ non_null: infer I }] ? ${p}GqlSdlFilled<C, I, E, U, D> : C extends null | undefined ? C : [F] extends [{ list: infer I }] ? (C extends readonly unknown[] ? { [K in keyof C]: ${p}GqlSdlFilled<C[K], I, ${p}GqlElemOf<E>, U, ${p}GqlDepth[D]> } : C) : [F] extends [{ type: infer T }] ? ([T] extends [keyof ${p}GqlTypes] ? (C extends readonly unknown[] ? C : C extends (...args: any[]) => any ? C : C extends object ? { [K in keyof C]: [${p}GqlConvertedField<C[K], ${p}GqlFieldOf<T, K>>] extends [true] ? ${p}GqlSdlDeclared<${p}GqlAt<E, K>, ${p}GqlFieldOf<T, K>, U, ${p}GqlDepth[D]> : ${p}GqlSdlFilled<C[K], ${p}GqlFieldOf<T, K>, ${p}GqlAt<E, K>, U, ${p}GqlDepth[D]> } & { [K in Exclude<keyof ${p}GqlTypes[T], keyof C> & ${p}GqlNames<E>]: ${p}GqlSdlDeclared<${p}GqlAt<E, K>, ${p}GqlFieldOf<T, K>, U, ${p}GqlDepth[D]> } : C) : C) : C;`,
|
|
331
384
|
];
|
|
332
385
|
}
|
|
333
386
|
/**
|
|
334
|
-
* The
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
* the
|
|
387
|
+
* The declared line's sent type (carrick#4726): the scalar form's wire type
|
|
388
|
+
* whenever that already assigns, else the wire type with the fields the
|
|
389
|
+
* record lacks or converts in the type the schema declares
|
|
390
|
+
* (`graphqlDeclaredDeclarations`). The short-circuit keeps every pair the wire
|
|
391
|
+
* line passes exactly as it was. `wire` is the scalar form's wire type,
|
|
392
|
+
* `relaxed` the consumer's reading, `leaf` the comparand's SDL leaf. The probe
|
|
393
|
+
* and the held check write this one text.
|
|
339
394
|
*/
|
|
340
|
-
export function
|
|
341
|
-
|
|
395
|
+
export function graphqlDeclaredRule(wire, relaxed, leaf, prefix, unread = 'any') {
|
|
396
|
+
const u = unread === 'any' ? 'any' : `${prefix}GqlUnread`;
|
|
397
|
+
return `[${wire}] extends [${relaxed}] ? ${wire} : ${prefix}GqlSdlFilled<${wire}, ${leaf}, ${relaxed}, ${u}>`;
|
|
342
398
|
}
|
|
343
399
|
export function decisiveAssignmentLine(plan) {
|
|
344
400
|
return plan.wireAssignmentLine ?? plan.assignmentLine;
|
|
@@ -375,9 +431,8 @@ export function buildProbe(spec, packageOf, unwidenedAliasFor, expectedTolerates
|
|
|
375
431
|
};
|
|
376
432
|
importLines.push(push(`import type { ${sentEndpoint.alias} as Sent } from '${sentPkg}';`));
|
|
377
433
|
importLines.push(push(`import type { ${expectedEndpoint.alias} as Expected } from '${expectedPkg}';`));
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
push(`type IsNever<T> = [T] extends [never] ? true : false;`);
|
|
434
|
+
for (const line of topTypeDeclarations(''))
|
|
435
|
+
push(line);
|
|
381
436
|
push(`type Not<T extends boolean> = T extends true ? false : true;`);
|
|
382
437
|
push(`type Assert<T extends true> = T;`);
|
|
383
438
|
gateLines.set(push(`type _G_sent_any = Assert<Not<IsAny<Sent>>>;`), 'sent:any');
|
|
@@ -449,9 +504,7 @@ export function buildProbe(spec, packageOf, unwidenedAliasFor, expectedTolerates
|
|
|
449
504
|
// remains is compared as before. The request direction of HTTP, and socket
|
|
450
505
|
// and pub/sub payloads (the subscriber is `expected`); a GraphQL request is
|
|
451
506
|
// not read this way.
|
|
452
|
-
const absentBodyAllowed = (spec.protocol
|
|
453
|
-
spec.protocol === 'socket' ||
|
|
454
|
-
spec.protocol === 'pubsub';
|
|
507
|
+
const absentBodyAllowed = absentBodyApplies(spec.protocol, spec.type_kind);
|
|
455
508
|
const toleratesAbsence = expectedToleratesAbsence?.(expectedEndpoint) === true;
|
|
456
509
|
const sentBodyType = (sent) => absentBodyRule(sent, 'Expected', toleratesAbsence);
|
|
457
510
|
if (absentBodyAllowed)
|
|
@@ -468,6 +521,9 @@ export function buildProbe(spec, packageOf, unwidenedAliasFor, expectedTolerates
|
|
|
468
521
|
});
|
|
469
522
|
let assignmentLine;
|
|
470
523
|
let wireAssignmentLine;
|
|
524
|
+
let declaredFromLine;
|
|
525
|
+
let declaredAssignmentLine;
|
|
526
|
+
let declaredReadLine;
|
|
471
527
|
if (spec.protocol === 'graphql') {
|
|
472
528
|
// GraphQL selection-set semantics (v1 `unwrapGraphqlPayload` parity): the
|
|
473
529
|
// producer side (always `sent` for graphql — see the direction table) is
|
|
@@ -558,12 +614,22 @@ export function buildProbe(spec, packageOf, unwidenedAliasFor, expectedTolerates
|
|
|
558
614
|
push(`type GqlWire = ${graphqlScalarWireRule('GqlComparand', 'GqlExpected', 'GqlComparandLeaf', '')};`);
|
|
559
615
|
push(`declare const sentWire: GqlWire;`);
|
|
560
616
|
wireAssignmentLine = push(`const expectedWire: GqlExpected = sentWire;`);
|
|
561
|
-
// carrick#
|
|
562
|
-
//
|
|
563
|
-
|
|
617
|
+
// carrick#4726: the declared line (`graphqlDeclaredRule`). Every line
|
|
618
|
+
// sits after the wire line, so no line above it moves. When the wire
|
|
619
|
+
// line fails, this line decides.
|
|
620
|
+
const [firstDeclared, ...restDeclared] = graphqlDeclaredDeclarations('');
|
|
621
|
+
declaredFromLine = push(firstDeclared);
|
|
622
|
+
for (const line of restDeclared)
|
|
564
623
|
push(line);
|
|
565
|
-
push(`type
|
|
566
|
-
|
|
624
|
+
push(`type GqlDeclared = ${graphqlDeclaredRule('GqlWire', 'GqlExpected', 'GqlComparandLeaf', '')};`);
|
|
625
|
+
push(`declare const sentDeclared: GqlDeclared;`);
|
|
626
|
+
declaredAssignmentLine = push(`const expectedDeclared: GqlExpected = sentDeclared;`);
|
|
627
|
+
// The same fill with every key the table could not answer as a type
|
|
628
|
+
// that assigns to nothing the consumer reads: it fails where the line
|
|
629
|
+
// above passed only through such a key.
|
|
630
|
+
push(`type GqlDeclaredRead = ${graphqlDeclaredRule('GqlWire', 'GqlExpected', 'GqlComparandLeaf', '', 'unread')};`);
|
|
631
|
+
push(`declare const sentDeclaredRead: GqlDeclaredRead;`);
|
|
632
|
+
declaredReadLine = push(`const expectedDeclaredRead: GqlExpected = sentDeclaredRead;`);
|
|
567
633
|
}
|
|
568
634
|
}
|
|
569
635
|
else {
|
|
@@ -655,6 +721,9 @@ export function buildProbe(spec, packageOf, unwidenedAliasFor, expectedTolerates
|
|
|
655
721
|
gateLines,
|
|
656
722
|
assignmentLine,
|
|
657
723
|
wireAssignmentLine,
|
|
724
|
+
...(declaredAssignmentLine === undefined
|
|
725
|
+
? {}
|
|
726
|
+
: { declaredFromLine, declaredAssignmentLine, declaredReadLine }),
|
|
658
727
|
...(unwidenedFromLine === undefined ? {} : { unwidenedFromLine }),
|
|
659
728
|
};
|
|
660
729
|
}
|
|
@@ -52,10 +52,10 @@ export type { InternalTypeChecker } from './node-builder.js';
|
|
|
52
52
|
export { toPosix } from './installed-package.js';
|
|
53
53
|
export { constituentsOf } from './result-label.js';
|
|
54
54
|
export { moduleExport } from './anchors.js';
|
|
55
|
-
export { callNamedBy, callResultNamesNoCall, isFrameworkMachinery, nodeByLocatorText, normalizeLocatorText, symbolDeclaredOutside, typeIsOrContainsMachinery, wrapsValueTransparently, type DeclaredOutside, } from './site-node.js';
|
|
55
|
+
export { anchorInHandler, callNamedBy, callResultNamesNoCall, isFrameworkMachinery, nodeByLocatorText, normalizeLocatorText, symbolDeclaredOutside, typeIsOrContainsMachinery, wrapsValueTransparently, type DeclaredOutside, type HandlerLines, } from './site-node.js';
|
|
56
56
|
export { runCheck, judgeTscPath } from './check.js';
|
|
57
57
|
export type { CheckProgress } from './check.js';
|
|
58
|
-
export { graphqlComparandLeafRule, graphqlComparandRule, graphqlExpectedRule,
|
|
58
|
+
export { absentBodyApplies, absentBodyRule, graphqlComparandLeafRule, graphqlComparandRule, graphqlExpectedRule, graphqlDeclaredDeclarations, graphqlDeclaredRule, graphqlGenericDeclarations, graphqlLeafWalkDeclarations, graphqlScalarWireRule, jsonWireDeclarations, jsonWireRule, judgeTolerances, topTypeDeclarations, wireFormFor, type JudgeTolerances, } from './check-probe.js';
|
|
59
59
|
export { fitOptionsOf, judgeFitOptions, type FitOptions } from './check-workspace.js';
|
|
60
60
|
export { nodeByExpressionText, isPreferredTarget } from './anchors.js';
|
|
61
61
|
export { graphqlDeclaresType, graphqlFieldLeaf, graphqlReachableFields, graphqlRootLeaf, graphqlScalarSent, withoutNonNull, } from './graphql-leaves.js';
|
|
@@ -100,3 +100,4 @@ export declare function removeStaleSurfaceEntries(dir: string, guard: WriteGuard
|
|
|
100
100
|
export declare function sanitizeServiceName(name: string): string;
|
|
101
101
|
export declare function captureStub(opts: CaptureStubOptions): CaptureStubResult;
|
|
102
102
|
export { classifyStatusCodes, httpStatus, statesNoBody, statesNoShape, statusKeyCode, statusTableBody, statusTableOf, successEntries, } from './status-table.js';
|
|
103
|
+
export { STATUS_MEMBER_NAMES, chainStatus, isDroppedReplyStatus, replyStatus, resultTypeStatusCodes, statedStatusCodes, statusCodesOfType, valueStatus, type ReplyStatus, } from './reply-status.js';
|
|
@@ -75,11 +75,11 @@ export { constituentsOf } from './result-label.js';
|
|
|
75
75
|
export { moduleExport } from './anchors.js';
|
|
76
76
|
// One node locator and one machinery test for the inferrer and the capture
|
|
77
77
|
// (carrick#3500).
|
|
78
|
-
export { callNamedBy, callResultNamesNoCall, isFrameworkMachinery, nodeByLocatorText, normalizeLocatorText, symbolDeclaredOutside, typeIsOrContainsMachinery, wrapsValueTransparently, } from './site-node.js';
|
|
78
|
+
export { anchorInHandler, callNamedBy, callResultNamesNoCall, isFrameworkMachinery, nodeByLocatorText, normalizeLocatorText, symbolDeclaredOutside, typeIsOrContainsMachinery, wrapsValueTransparently, } from './site-node.js';
|
|
79
79
|
// v2 check core ("tsc as the judge"). Same bundle, same seam: the sidecar
|
|
80
80
|
// reaches it only through this door (index.js).
|
|
81
81
|
export { runCheck, judgeTscPath } from './check.js';
|
|
82
|
-
export { graphqlComparandLeafRule, graphqlComparandRule, graphqlExpectedRule,
|
|
82
|
+
export { absentBodyApplies, absentBodyRule, graphqlComparandLeafRule, graphqlComparandRule, graphqlExpectedRule, graphqlDeclaredDeclarations, graphqlDeclaredRule, graphqlGenericDeclarations, graphqlLeafWalkDeclarations, graphqlScalarWireRule, jsonWireDeclarations, jsonWireRule, judgeTolerances, topTypeDeclarations, wireFormFor, } from './check-probe.js';
|
|
83
83
|
export { fitOptionsOf, judgeFitOptions } from './check-workspace.js';
|
|
84
84
|
export { nodeByExpressionText, isPreferredTarget } from './anchors.js';
|
|
85
85
|
export { graphqlDeclaresType, graphqlFieldLeaf, graphqlReachableFields, graphqlRootLeaf, graphqlScalarSent, withoutNonNull, } from './graphql-leaves.js';
|
|
@@ -236,6 +236,15 @@ export function captureStub(opts) {
|
|
|
236
236
|
const packageName = `@carrick/${sanitizeServiceName(opts.serviceName)}`;
|
|
237
237
|
const stubDir = path.resolve(opts.outDir);
|
|
238
238
|
const errors = [];
|
|
239
|
+
// A cause the driver names is a word of the one list of reasons.
|
|
240
|
+
const unknownCause = opts.anchors.find((anchor) => anchor.kind === 'literal' &&
|
|
241
|
+
anchor.unread_cause !== undefined &&
|
|
242
|
+
!Object.hasOwn(typeReasons, anchor.unread_cause));
|
|
243
|
+
if (unknownCause?.kind === 'literal') {
|
|
244
|
+
return fail(stubDir, packageName, [
|
|
245
|
+
`unread_cause '${unknownCause.unread_cause}' on ${unknownCause.alias} is not a key of type-reasons.json`,
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
239
248
|
// Under CARRICK_UNTRUSTED_TREE every compiler read below is held to the
|
|
240
249
|
// checkout, the sidecar's own install, these stub dirs and a Deno graph's
|
|
241
250
|
// npm packages (`bound`, built once the Deno graph exists); otherwise
|
|
@@ -1346,3 +1355,6 @@ function resolveAnchors(opts, parsed, ctx, deno, owner) {
|
|
|
1346
1355
|
// carrick#1841: the response-table reading the inferrer and the v1 bundle
|
|
1347
1356
|
// share with the capture's symbol anchor.
|
|
1348
1357
|
export { classifyStatusCodes, httpStatus, statesNoBody, statesNoShape, statusKeyCode, statusTableBody, statusTableOf, successEntries, } from './status-table.js';
|
|
1358
|
+
// The one reader of a reply's HTTP status: the inferrer reads
|
|
1359
|
+
// a located reply with it; the capture reads the same module.
|
|
1360
|
+
export { STATUS_MEMBER_NAMES, chainStatus, isDroppedReplyStatus, replyStatus, resultTypeStatusCodes, statedStatusCodes, statusCodesOfType, valueStatus, } from './reply-status.js';
|