@lovrozagar/oat 0.2.2 → 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/README.md +15 -1
- package/dist/cli.js +13 -1
- package/dist/runtime/checks.d.ts.map +1 -1
- package/dist/runtime/checks.js +38 -21
- package/dist/runtime/checks.js.map +1 -1
- package/dist/runtime/fixture.d.ts +28 -1
- package/dist/runtime/fixture.d.ts.map +1 -1
- package/dist/runtime/fixture.js +551 -90
- package/dist/runtime/fixture.js.map +1 -1
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +106 -34
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/world.d.ts +5 -0
- package/dist/runtime/world.d.ts.map +1 -1
- package/dist/runtime/world.js +43 -3
- package/dist/runtime/world.js.map +1 -1
- package/dist/spec/graph.d.ts.map +1 -1
- package/dist/spec/graph.js +5 -1
- package/dist/spec/graph.js.map +1 -1
- package/dist/spec/load.d.ts.map +1 -1
- package/dist/spec/load.js +19 -4
- package/dist/spec/load.js.map +1 -1
- package/package.json +3 -2
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* order, escaping needs metacharacters. oat seeds a *discriminating cohort* — instances shaped so
|
|
6
6
|
* that every query assertion has signal — and derives everything from a seed so a failing run is
|
|
7
7
|
* exactly reproducible.
|
|
8
|
+
*
|
|
9
|
+
* After `$ref` inlining the same object identity can cycle, and empty schemas (`{}`, `true`,
|
|
10
|
+
* `additionalProperties: {}`) mean "any value", not "walk this object again". Generation therefore
|
|
11
|
+
* keys a WeakSet on every node and treats those open shapes as a scalar or `{}`.
|
|
8
12
|
*/
|
|
9
13
|
export type Variant = "baseline" | "lexical-first" | "lexical-last" | "null-heavy" | "unicode" | "metacharacter" | "boundary";
|
|
10
14
|
export declare const COHORT: readonly Variant[];
|
|
@@ -15,6 +19,29 @@ export interface CohortMember {
|
|
|
15
19
|
variant: Variant;
|
|
16
20
|
body: Record<string, unknown>;
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
/** Thrown when a walk still overflows; the pointer names the node that blew the stack. */
|
|
23
|
+
export declare class FixtureOverflow extends Error {
|
|
24
|
+
readonly operationId: string;
|
|
25
|
+
readonly pointer: string;
|
|
26
|
+
constructor(operationId: string, pointer: string);
|
|
27
|
+
}
|
|
28
|
+
export declare function overflowFrom(error: unknown, operationId: string, pointer?: string): FixtureOverflow;
|
|
29
|
+
export declare function isOverflowError(error: unknown): boolean;
|
|
30
|
+
export declare function buildCohort(bodySchema: Schema | boolean, seed: number, variants?: readonly Variant[], operationId?: string): CohortMember[];
|
|
31
|
+
/**
|
|
32
|
+
* One create body, or a gap if a required field cannot be honoured.
|
|
33
|
+
*
|
|
34
|
+
* Optional fields that cannot match `format`/`pattern` are omitted. Required ones must not fall
|
|
35
|
+
* back to `"Quarterly Report N"` — that is what 400s every email/handle/url field.
|
|
36
|
+
*/
|
|
37
|
+
export declare function generateBody(bodySchema: Schema | boolean, variant: Variant, rand: () => number, index: number, operationId?: string): {
|
|
38
|
+
body: Record<string, unknown>;
|
|
39
|
+
missingRequired: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* `{}` / `true` / a lone `additionalProperties: {}` is "any JSON", not an object to descend.
|
|
43
|
+
* Walking it again is what turns `z.unknown()` into a stack overflow.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isVacuous(schema: unknown): boolean;
|
|
19
46
|
export {};
|
|
20
47
|
//# sourceMappingURL=fixture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/runtime/fixture.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/runtime/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,OAAO,GAChB,UAAU,GACV,eAAe,GACf,cAAc,GACd,YAAY,GACZ,SAAS,GAC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