@fougere/testing 0.5.0-alpha.1 → 0.7.0-alpha.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 +1 -1
- package/dist/all.d.ts +2 -17
- package/dist/all.d.ts.map +1 -1
- package/dist/all.js +2 -17
- package/dist/all.js.map +1 -1
- package/dist/app.d.ts +4 -35
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -17
- package/dist/app.js.map +1 -1
- package/dist/comparison.d.ts +3 -20
- package/dist/comparison.d.ts.map +1 -1
- package/dist/comparison.js +29 -58
- package/dist/comparison.js.map +1 -1
- package/dist/derive.d.ts +3 -9
- package/dist/derive.d.ts.map +1 -1
- package/dist/derive.js +1 -7
- package/dist/derive.js.map +1 -1
- package/dist/doors.d.ts +4 -22
- package/dist/doors.d.ts.map +1 -1
- package/dist/doors.js +6 -24
- package/dist/doors.js.map +1 -1
- package/dist/gql.d.ts +5 -24
- package/dist/gql.d.ts.map +1 -1
- package/dist/gql.js +11 -37
- package/dist/gql.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/load.d.ts +3 -20
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +6 -23
- package/dist/load.js.map +1 -1
- package/dist/remotes.d.ts +1 -6
- package/dist/remotes.d.ts.map +1 -1
- package/dist/remotes.js +1 -6
- package/dist/remotes.js.map +1 -1
- package/dist/sample.d.ts +2 -14
- package/dist/sample.d.ts.map +1 -1
- package/dist/sample.js +8 -16
- package/dist/sample.js.map +1 -1
- package/dist/scope.d.ts +5 -38
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js +4 -26
- package/dist/scope.js.map +1 -1
- package/dist/stub.d.ts +3 -32
- package/dist/stub.d.ts.map +1 -1
- package/dist/stub.js +3 -32
- package/dist/stub.js.map +1 -1
- package/dist/sync.d.ts +2 -19
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +5 -22
- package/dist/sync.js.map +1 -1
- package/dist/vitest.d.ts +1 -20
- package/dist/vitest.d.ts.map +1 -1
- package/dist/vitest.js +1 -20
- package/dist/vitest.js.map +1 -1
- package/package.json +9 -9
- package/src/all.ts +2 -17
- package/src/app.ts +5 -41
- package/src/comparison.ts +34 -63
- package/src/derive.ts +3 -9
- package/src/doors.ts +7 -25
- package/src/gql.ts +9 -35
- package/src/index.ts +1 -1
- package/src/load.ts +7 -24
- package/src/remotes.ts +1 -6
- package/src/sample.ts +10 -30
- package/src/scope.ts +5 -38
- package/src/stub.ts +3 -32
- package/src/sync.ts +5 -22
- package/src/vitest.ts +1 -20
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ import Product from '../fronds/catalog/entities/Product.js';
|
|
|
19
19
|
|
|
20
20
|
const app = await testApp();
|
|
21
21
|
|
|
22
|
-
checkContract(app, Product); // every refusal the
|
|
22
|
+
checkContract(app, Product); // every refusal the validator can state
|
|
23
23
|
checkOutput(app, Product); // no writeOnly field leaves
|
|
24
24
|
checkDoors(app, Product); // local · REST · GraphQL · RPC answer the same
|
|
25
25
|
```
|
package/dist/all.d.ts
CHANGED
|
@@ -8,26 +8,11 @@ export interface CheckAllOptions extends DoorOptions, CheckOptions {
|
|
|
8
8
|
/** Skip the four-door comparison. The contract and the leak are still checked. */
|
|
9
9
|
doors?: boolean;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Every entity the app SERVES, with its handler.
|
|
13
|
-
*
|
|
14
|
-
* Not every entity it scanned: one with no handler has no façade, so there is no door to
|
|
15
|
-
* ask — the distinction the NOT_FOUND message used to miss. A relation is not followed
|
|
16
|
-
* either; the entity it points at is checked on its own turn if it has a door.
|
|
17
|
-
*/
|
|
11
|
+
/** Every entity the app SERVES, with its handler. */
|
|
18
12
|
export declare function servedEntities(app: App): {
|
|
19
13
|
name: string;
|
|
20
14
|
entity: SchemaView;
|
|
21
15
|
}[];
|
|
22
|
-
/**
|
|
23
|
-
* The whole suite, for every entity, from a file that names none of them.
|
|
24
|
-
*
|
|
25
|
-
* The list comes from the scan rather than from imports, and that is the point: a list of
|
|
26
|
-
* imports is a second copy of what the project already declares, and it goes stale the day
|
|
27
|
-
* an entity is added — silently, because a missing test cannot fail.
|
|
28
|
-
*
|
|
29
|
-
* An entity whose frond is declared in `remotes:` is not here at all: it is not this app's
|
|
30
|
-
* to serve, and `testApp` does not follow the topology in the first place.
|
|
31
|
-
*/
|
|
16
|
+
/** The whole suite, for every entity, from a file that names none of them. */
|
|
32
17
|
export declare function checkAll(app: App, options?: CheckAllOptions): void;
|
|
33
18
|
//# sourceMappingURL=all.d.ts.map
|
package/dist/all.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,EAAE,CAS/E;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAetE"}
|
package/dist/all.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { checkContract, checkOutput } from './doors.js';
|
|
3
3
|
import { checkDoors } from './comparison.js';
|
|
4
|
-
/**
|
|
5
|
-
* Every entity the app SERVES, with its handler.
|
|
6
|
-
*
|
|
7
|
-
* Not every entity it scanned: one with no handler has no façade, so there is no door to
|
|
8
|
-
* ask — the distinction the NOT_FOUND message used to miss. A relation is not followed
|
|
9
|
-
* either; the entity it points at is checked on its own turn if it has a door.
|
|
10
|
-
*/
|
|
4
|
+
/** Every entity the app SERVES, with its handler. */
|
|
11
5
|
export function servedEntities(app) {
|
|
12
6
|
const served = [];
|
|
13
7
|
for (const frond of app.fronds) {
|
|
@@ -19,16 +13,7 @@ export function servedEntities(app) {
|
|
|
19
13
|
}
|
|
20
14
|
return served;
|
|
21
15
|
}
|
|
22
|
-
/**
|
|
23
|
-
* The whole suite, for every entity, from a file that names none of them.
|
|
24
|
-
*
|
|
25
|
-
* The list comes from the scan rather than from imports, and that is the point: a list of
|
|
26
|
-
* imports is a second copy of what the project already declares, and it goes stale the day
|
|
27
|
-
* an entity is added — silently, because a missing test cannot fail.
|
|
28
|
-
*
|
|
29
|
-
* An entity whose frond is declared in `remotes:` is not here at all: it is not this app's
|
|
30
|
-
* to serve, and `testApp` does not follow the topology in the first place.
|
|
31
|
-
*/
|
|
16
|
+
/** The whole suite, for every entity, from a file that names none of them. */
|
|
32
17
|
export function checkAll(app, options = {}) {
|
|
33
18
|
const except = new Set(options.except ?? []);
|
|
34
19
|
const served = servedEntities(app).filter((one) => !except.has(one.name));
|
package/dist/all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAS/D
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAS/D,qDAAqD;AACrD,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,MAAM,MAAM,GAA2C,EAAE,CAAC;IAC1D,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClH,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,GAAQ,EAAE,OAAO,GAAoB,EAAE;IAC9D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1E,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QAChC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK;YAAE,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
|
package/dist/app.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { type App } from '@fougere/core';
|
|
2
2
|
import { type Port, type Stub } from './stub.js';
|
|
3
3
|
export interface TestAppOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The project to scan. Read from the test file's own position when absent — a file
|
|
6
|
-
* under `fronds/blog/tests/` states that its subject is `blog` and that the project
|
|
7
|
-
* starts above `fronds/`.
|
|
8
|
-
*/
|
|
4
|
+
/** The project to scan. */
|
|
9
5
|
root?: string;
|
|
10
6
|
/** Boot only these fronds, by name. Deduced from the position when absent. */
|
|
11
7
|
fronds?: string[];
|
|
@@ -14,15 +10,7 @@ export interface TestAppOptions {
|
|
|
14
10
|
* through `expect.getState()`; anything else hands its own path in.
|
|
15
11
|
*/
|
|
16
12
|
testPath?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Where the rows go. `':memory:'` by default — a real SQLite engine, so the DDL, the
|
|
19
|
-
* `CHECK` constraints, `unique` and real transactions are all exercised, and nothing is
|
|
20
|
-
* written to disk.
|
|
21
|
-
*
|
|
22
|
-
* Not an in-memory ORM: `createMemoryOrm` realizes the axes but is not the engine
|
|
23
|
-
* production runs, and a tool whose thesis is *the realizations must agree* cannot pick
|
|
24
|
-
* the one that does not ship.
|
|
25
|
-
*/
|
|
13
|
+
/** Where the rows go. */
|
|
26
14
|
db?: string;
|
|
27
15
|
/**
|
|
28
16
|
* Follow `remotes:` from the config. False by default — a test that meant to exercise
|
|
@@ -39,30 +27,11 @@ export interface TestAppOptions {
|
|
|
39
27
|
export interface TestApp extends App {
|
|
40
28
|
/** The double installed for a port, to state a return or read what was called. */
|
|
41
29
|
stub<T>(port: abstract new (...args: never[]) => T): Stub<T>;
|
|
42
|
-
/**
|
|
43
|
-
* What was announced under a fact's name, in order.
|
|
44
|
-
*
|
|
45
|
-
* Read from the carrier's own seat: `Emissions.announce` hands EVERY announced fact to
|
|
46
|
-
* `onEmit`, whether or not anything in this process listens. So watching costs nothing
|
|
47
|
-
* and adds no second dispatcher — the one thing `Emissions` refuses to become.
|
|
48
|
-
*
|
|
49
|
-
* Its dual needs no help at all: `app.deliver(fact, payload)` is already the carrier's
|
|
50
|
-
* door, and it rejects when a subscriber refuses.
|
|
51
|
-
*/
|
|
30
|
+
/** What was announced under a fact's name, in order. */
|
|
52
31
|
announced(fact: {
|
|
53
32
|
name: string;
|
|
54
33
|
} | string): unknown[];
|
|
55
34
|
}
|
|
56
|
-
/**
|
|
57
|
-
* An app to ask questions of, wired the conventional way.
|
|
58
|
-
*
|
|
59
|
-
* Wraps `boot()`, which already loads the config, creates the container, sets the storage
|
|
60
|
-
* up and seeds — its own comment names tests among the surfaces it serves. What this adds
|
|
61
|
-
* is the two decisions a test makes differently: the rows live in memory, and the
|
|
62
|
-
* topology is not followed.
|
|
63
|
-
*
|
|
64
|
-
* Storage still goes through `resolveStorage`, the single place that knows a storage
|
|
65
|
-
* package; calling `setupSqlite` here would be a second one.
|
|
66
|
-
*/
|
|
35
|
+
/** An app to ask questions of, wired the conventional way. */
|
|
67
36
|
export declare function testApp(options?: TestAppOptions): Promise<TestApp>;
|
|
68
37
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAgB,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAI/D,MAAM,WAAW,cAAc;IAC7B
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAgB,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAI/D,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;CACf;AAED,0FAA0F;AAC1F,MAAM,WAAW,OAAQ,SAAQ,GAAG;IAClC,kFAAkF;IAClF,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7D,wDAAwD;IACxD,SAAS,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC;CACvD;AAED,8DAA8D;AAC9D,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyC5E"}
|
package/dist/app.js
CHANGED
|
@@ -4,17 +4,7 @@ import { resolveStorage } from '@fougere/defaults';
|
|
|
4
4
|
import { installStubs } from './stub.js';
|
|
5
5
|
import { scopeOfRun } from './scope.js';
|
|
6
6
|
import { lowerFirst } from '@fougere/schema';
|
|
7
|
-
/**
|
|
8
|
-
* An app to ask questions of, wired the conventional way.
|
|
9
|
-
*
|
|
10
|
-
* Wraps `boot()`, which already loads the config, creates the container, sets the storage
|
|
11
|
-
* up and seeds — its own comment names tests among the surfaces it serves. What this adds
|
|
12
|
-
* is the two decisions a test makes differently: the rows live in memory, and the
|
|
13
|
-
* topology is not followed.
|
|
14
|
-
*
|
|
15
|
-
* Storage still goes through `resolveStorage`, the single place that knows a storage
|
|
16
|
-
* package; calling `setupSqlite` here would be a second one.
|
|
17
|
-
*/
|
|
7
|
+
/** An app to ask questions of, wired the conventional way. */
|
|
18
8
|
export async function testApp(options = {}) {
|
|
19
9
|
const db = { dialect: 'sqlite', path: options.db ?? ':memory:' };
|
|
20
10
|
// The position is consulted only for what the caller did not state: an explicit `root`
|
|
@@ -52,12 +42,7 @@ export async function testApp(options = {}) {
|
|
|
52
42
|
},
|
|
53
43
|
});
|
|
54
44
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Vitest's own answer to "which file is running", or nothing.
|
|
57
|
-
*
|
|
58
|
-
* Imported dynamically: a package that imports vitest at the top level stops being
|
|
59
|
-
* loadable outside a test run, and `testApp` is meant to work under any host.
|
|
60
|
-
*/
|
|
45
|
+
/** Vitest's own answer to "which file is running", or nothing. */
|
|
61
46
|
function currentTestPath() {
|
|
62
47
|
const globals = globalThis;
|
|
63
48
|
return globals.__vitest_worker__?.filepath;
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAkC7C,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAO,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;YAC3E,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1F,CAAC;QACD,IAAI,CAAI,IAA0C;YAChD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CACb,UAAW,IAAa,CAAC,IAAI,gDAAiD,IAAa,CAAC,IAAI,OAAO,CACxG,CAAC;YACJ,CAAC;YACD,OAAO,KAAgB,CAAC;QAC1B,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kEAAkE;AAClE,SAAS,eAAe;IACtB,MAAM,OAAO,GAAG,UAA2D,CAAC;IAC5E,OAAO,OAAO,CAAC,iBAAiB,EAAE,QAAQ,CAAC;AAC7C,CAAC"}
|
package/dist/comparison.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface DoorOptions extends SampleOptions {
|
|
|
8
8
|
}
|
|
9
9
|
export interface DoorInput {
|
|
10
10
|
id?: string;
|
|
11
|
-
|
|
11
|
+
input?: Record<string, unknown>;
|
|
12
12
|
}
|
|
13
13
|
export interface DoorContractCase {
|
|
14
14
|
/** What this case proves — becomes the test name. */
|
|
@@ -19,25 +19,8 @@ export interface DoorContractCase {
|
|
|
19
19
|
/** The protocol envelopes are removed before this value is compared. */
|
|
20
20
|
expected: unknown;
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
* One entity, four doors, the same answers.
|
|
24
|
-
*
|
|
25
|
-
* The claim runs through the whole repo — a frond runs in-process or behind JSON-RPC with
|
|
26
|
-
* identical user code, and REST, GraphQL and RPC are three projections of one contract —
|
|
27
|
-
* and nothing compared REST to GraphQL until now. `transport-swap.test.ts` compares three
|
|
28
|
-
* TRANSPORTS, which is a different sentence.
|
|
29
|
-
*
|
|
30
|
-
* The five CRUD operations, reads and writes. A CUSTOM op is not compared: REST addresses
|
|
31
|
-
* it by a path the table states, GraphQL by a mutation whose input type is its own, and
|
|
32
|
-
* matching the two means guessing which is which — a guess this file exists to avoid.
|
|
33
|
-
*/
|
|
22
|
+
/** One entity, four doors, the same answers. */
|
|
34
23
|
export declare function checkDoors(app: App, entity: SchemaView, options?: DoorOptions): void;
|
|
35
|
-
/**
|
|
36
|
-
* Run one hand-written invocation contract through every door.
|
|
37
|
-
*
|
|
38
|
-
* `checkDoors` derives the generic CRUD gradient. This is its small explicit companion
|
|
39
|
-
* for semantics only the handler can observe — notably omitted versus null input. A new
|
|
40
|
-
* adapter joins the same harness instead of inventing its own interpretation.
|
|
41
|
-
*/
|
|
24
|
+
/** Run one hand-written invocation contract through every door. */
|
|
42
25
|
export declare function checkDoorContract(app: App, entity: SchemaView, cases: readonly DoorContractCase[], options?: Pick<DoorOptions, 'surface'>): void;
|
|
43
26
|
//# sourceMappingURL=comparison.d.ts.map
|
package/dist/comparison.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../src/comparison.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../src/comparison.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAmB9D,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AASD,MAAM,WAAW,SAAS;IAAG,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,gDAAgD;AAChD,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CA8ExF;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAM,GACzC,IAAI,CAeN"}
|
package/dist/comparison.js
CHANGED
|
@@ -5,13 +5,7 @@ import { serveRest, serveRpc, tableOf } from '@fougere/app';
|
|
|
5
5
|
import { lowerFirst } from '@fougere/schema';
|
|
6
6
|
import { listQuery, findQuery, mutationFor, at } from './gql.js';
|
|
7
7
|
import { sampleInput } from './sample.js';
|
|
8
|
-
/**
|
|
9
|
-
* The rows a door hands back, with its own envelope taken off.
|
|
10
|
-
*
|
|
11
|
-
* Each door wraps differently by construction — REST answers a page, GraphQL nests under
|
|
12
|
-
* its field, RPC returns the value — and comparing the wrappers would compare the
|
|
13
|
-
* protocols. What must agree is what is inside.
|
|
14
|
-
*/
|
|
8
|
+
/** The rows a door hands back, with its own envelope taken off. */
|
|
15
9
|
function rowsOf(value) {
|
|
16
10
|
if (Array.isArray(value))
|
|
17
11
|
return [...value];
|
|
@@ -20,46 +14,29 @@ function rowsOf(value) {
|
|
|
20
14
|
}
|
|
21
15
|
/** Through the wire and back, so a `Date` and its ISO string are not read as a divergence. */
|
|
22
16
|
const wire = (value) => JSON.parse(JSON.stringify(value ?? null));
|
|
23
|
-
/**
|
|
24
|
-
* What is the SAME row seen twice, and what is merely a second row.
|
|
25
|
-
*
|
|
26
|
-
* A write creates a different row at each door — different id, different `createdAt` —
|
|
27
|
-
* so comparing values would compare clocks. The generated fields are dropped and what the
|
|
28
|
-
* caller sent is what remains, which is the part the doors must agree on.
|
|
29
|
-
*/
|
|
17
|
+
/** What is the SAME row seen twice, and what is merely a second row. */
|
|
30
18
|
function written(value, sent) {
|
|
31
19
|
const row = value;
|
|
32
20
|
if (!row || typeof row !== 'object')
|
|
33
21
|
return wire(row);
|
|
34
22
|
return wire(Object.fromEntries(Object.keys(sent).map((key) => [key, row[key]])));
|
|
35
23
|
}
|
|
36
|
-
/**
|
|
37
|
-
* One entity, four doors, the same answers.
|
|
38
|
-
*
|
|
39
|
-
* The claim runs through the whole repo — a frond runs in-process or behind JSON-RPC with
|
|
40
|
-
* identical user code, and REST, GraphQL and RPC are three projections of one contract —
|
|
41
|
-
* and nothing compared REST to GraphQL until now. `transport-swap.test.ts` compares three
|
|
42
|
-
* TRANSPORTS, which is a different sentence.
|
|
43
|
-
*
|
|
44
|
-
* The five CRUD operations, reads and writes. A CUSTOM op is not compared: REST addresses
|
|
45
|
-
* it by a path the table states, GraphQL by a mutation whose input type is its own, and
|
|
46
|
-
* matching the two means guessing which is which — a guess this file exists to avoid.
|
|
47
|
-
*/
|
|
24
|
+
/** One entity, four doors, the same answers. */
|
|
48
25
|
export function checkDoors(app, entity, options = {}) {
|
|
49
26
|
const name = lowerFirst(entity.name ?? '');
|
|
50
27
|
const doors = doorsOf(app, entity, name, options.surface);
|
|
51
|
-
const
|
|
28
|
+
const inputOf = () => sampleInput(entity, options.given ?? {}, options);
|
|
52
29
|
describe(`${entity.name} — the doors agree`, () => {
|
|
53
30
|
it('on create, over what the caller sent', async () => {
|
|
54
|
-
const sent =
|
|
55
|
-
const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => doors[door]('create', {
|
|
31
|
+
const sent = inputOf();
|
|
32
|
+
const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => doors[door]('create', { input: sent })));
|
|
56
33
|
const [local, ...others] = answers.map((answer) => written(answer, sent));
|
|
57
34
|
for (const [index, other] of others.entries()) {
|
|
58
35
|
expect(other, `${['rpc', 'rest', 'graphql'][index]} ≠ local`).toEqual(local);
|
|
59
36
|
}
|
|
60
37
|
});
|
|
61
38
|
it('on list', async () => {
|
|
62
|
-
await doors.local('create', {
|
|
39
|
+
await doors.local('create', { input: inputOf() });
|
|
63
40
|
const local = wire(rowsOf(await doors.local('list')));
|
|
64
41
|
expect(Array.isArray(local) && local.length > 0, 'nothing to compare').toBe(true);
|
|
65
42
|
expect(wire(rowsOf(await doors.rpc('list'))), 'rpc ≠ local').toEqual(local);
|
|
@@ -67,46 +44,40 @@ export function checkDoors(app, entity, options = {}) {
|
|
|
67
44
|
expect(wire(rowsOf(await doors.graphql('list'))), 'graphql ≠ local').toEqual(local);
|
|
68
45
|
});
|
|
69
46
|
it('on findById', async () => {
|
|
70
|
-
const row = await doors.local('create', {
|
|
47
|
+
const row = await doors.local('create', { input: inputOf() });
|
|
71
48
|
const local = wire(await doors.local('findById', { id: row.id }));
|
|
72
49
|
expect(wire(await doors.rpc('findById', { id: row.id })), 'rpc ≠ local').toEqual(local);
|
|
73
50
|
expect(wire(await doors.rest('findById', { id: row.id })), 'rest ≠ local').toEqual(local);
|
|
74
51
|
expect(wire(await doors.graphql('findById', { id: row.id })), 'graphql ≠ local').toEqual(local);
|
|
75
52
|
});
|
|
76
53
|
it('on update, over what the caller sent', async () => {
|
|
77
|
-
const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', {
|
|
78
|
-
const patch =
|
|
54
|
+
const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', { input: inputOf() })));
|
|
55
|
+
const patch = inputOf();
|
|
79
56
|
const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql']
|
|
80
|
-
.map((door, index) => doors[door]('update', { id: rows[index].id,
|
|
57
|
+
.map((door, index) => doors[door]('update', { id: rows[index].id, input: patch })));
|
|
81
58
|
const [local, ...others] = answers.map((answer) => written(answer, patch));
|
|
82
59
|
for (const [index, other] of others.entries()) {
|
|
83
60
|
expect(other, `${['rpc', 'rest', 'graphql'][index]} ≠ local`).toEqual(local);
|
|
84
61
|
}
|
|
85
62
|
});
|
|
86
63
|
it('on delete', async () => {
|
|
87
|
-
const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', {
|
|
64
|
+
const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', { input: inputOf() })));
|
|
88
65
|
const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door, index) => doors[door]('delete', { id: rows[index].id })));
|
|
89
66
|
// REST answers a deletion with no content at all, which is the protocol saying yes.
|
|
90
|
-
const
|
|
91
|
-
expect(new Set(
|
|
67
|
+
const onTheWire = answers.map((answer) => (answer === undefined || answer === null ? true : wire(answer)));
|
|
68
|
+
expect(new Set(onTheWire).size, `the doors disagree: ${JSON.stringify(onTheWire)}`).toBe(1);
|
|
92
69
|
});
|
|
93
70
|
it('on a refusal', async () => {
|
|
94
71
|
// A refusal is where the doors diverge most, and where each is most tempted to
|
|
95
72
|
// answer in its own words. What must match is that it WAS refused.
|
|
96
|
-
const bad = { ...
|
|
97
|
-
const refusals = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => refused(() => doors[door]('create', {
|
|
73
|
+
const bad = { ...inputOf(), __unknown__: 'x' };
|
|
74
|
+
const refusals = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => refused(() => doors[door]('create', { input: bad }))));
|
|
98
75
|
expect(refusals[0], 'local accepted a body outside the contract').toBe(true);
|
|
99
76
|
expect(refusals, `the doors disagree: ${JSON.stringify(refusals)}`).toEqual([true, true, true, true]);
|
|
100
77
|
});
|
|
101
78
|
});
|
|
102
79
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Run one hand-written invocation contract through every door.
|
|
105
|
-
*
|
|
106
|
-
* `checkDoors` derives the generic CRUD gradient. This is its small explicit companion
|
|
107
|
-
* for semantics only the handler can observe — notably omitted versus null input. A new
|
|
108
|
-
* adapter joins the same harness instead of inventing its own interpretation.
|
|
109
|
-
*/
|
|
80
|
+
/** Run one hand-written invocation contract through every door. */
|
|
110
81
|
export function checkDoorContract(app, entity, cases, options = {}) {
|
|
111
82
|
const name = lowerFirst(entity.name ?? '');
|
|
112
83
|
const doors = doorsOf(app, entity, name, options.surface);
|
|
@@ -135,41 +106,41 @@ async function refused(call) {
|
|
|
135
106
|
function doorsOf(app, entity, name, surface) {
|
|
136
107
|
const run = createLocalRunner(app, surface);
|
|
137
108
|
const state = {};
|
|
138
|
-
const invocation = (
|
|
109
|
+
const invocation = (call = {}) => ({
|
|
139
110
|
...EMPTY_INVOCATION,
|
|
140
|
-
...(
|
|
141
|
-
...(input
|
|
111
|
+
...(call.id !== undefined ? { params: { id: call.id } } : {}),
|
|
112
|
+
...(call.input !== undefined ? { input: call.input } : {}),
|
|
142
113
|
});
|
|
143
114
|
return {
|
|
144
|
-
local: (op,
|
|
145
|
-
rpc: async (op,
|
|
115
|
+
local: (op, call) => run({ entity: name, op }, invocation(call)),
|
|
116
|
+
rpc: async (op, call) => {
|
|
146
117
|
const answer = await serveRpc(app, {
|
|
147
118
|
path: '',
|
|
148
|
-
body: { jsonrpc: '2.0', id: 1, method: `${name}.${op}`, params: invocation(
|
|
119
|
+
body: { jsonrpc: '2.0', id: 1, method: `${name}.${op}`, params: invocation(call) },
|
|
149
120
|
state,
|
|
150
121
|
});
|
|
151
122
|
if (answer.error)
|
|
152
123
|
throw new Error(answer.error.message);
|
|
153
124
|
return answer.result;
|
|
154
125
|
},
|
|
155
|
-
rest: async (op,
|
|
126
|
+
rest: async (op, call) => {
|
|
156
127
|
// The route the REST door itself would match, read from its own table — rebuilding
|
|
157
128
|
// the path here would be a second opinion on where an entity lives.
|
|
158
129
|
const route = tableOf(app).find((one) => one.entityName === name && one.operationName === op);
|
|
159
130
|
if (!route)
|
|
160
131
|
throw new Error(`[checkDoors] REST serves no ${name}.${op}`);
|
|
161
|
-
const path = route.segments.map((segment) => (segment.startsWith(':') ?
|
|
162
|
-
const answer = await serveRest(app, { method: route.method, path, query: {}, body: input
|
|
132
|
+
const path = route.segments.map((segment) => (segment.startsWith(':') ? call?.id ?? '' : segment)).join('/');
|
|
133
|
+
const answer = await serveRest(app, { method: route.method, path, query: {}, body: call?.input, state });
|
|
163
134
|
if (answer.kind !== 'ok')
|
|
164
135
|
throw new Error(`[checkDoors] REST answered ${answer.kind} on ${name}.${op}`);
|
|
165
136
|
return answer.body;
|
|
166
137
|
},
|
|
167
|
-
graphql: async (op,
|
|
138
|
+
graphql: async (op, call) => {
|
|
168
139
|
const { executeOn, schemaOf } = await import('@fougere/adapter-graphql');
|
|
169
140
|
const schema = schemaOf(app);
|
|
170
141
|
const built = op === 'list' ? listQuery(schema, entity)
|
|
171
|
-
: op === 'findById' ? findQuery(schema, entity,
|
|
172
|
-
: mutationFor(schema, entity, op, { id:
|
|
142
|
+
: op === 'findById' ? findQuery(schema, entity, call?.id ?? '')
|
|
143
|
+
: mutationFor(schema, entity, op, { id: call?.id, input: call?.input });
|
|
173
144
|
if (!built)
|
|
174
145
|
throw new Error(`[checkDoors] GraphQL serves no ${entity.name} ${op}`);
|
|
175
146
|
const answer = await executeOn(app, { query: built.query, state });
|
package/dist/compar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M,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;YAEnF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAY,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5E,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAChG,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/derive.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ValidationCase } from '@fougere/schema';
|
|
2
2
|
import type { SchemaView } from '@fougere/schema';
|
|
3
3
|
import { type SampleOptions } from './sample.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* `Cases` lives in `@fougere/schema` because deriving them reads the four axes and
|
|
8
|
-
* nothing else. This is the half that needs a generator, which is why it is here: a
|
|
9
|
-
* 426 KB faker has no business in the package a browser loads.
|
|
10
|
-
*/
|
|
11
|
-
export declare function derivedCases(entity: SchemaView, given?: Record<string, unknown>, options?: SampleOptions): readonly Case[];
|
|
4
|
+
/** The cases, with the valid body generated rather than handed in. */
|
|
5
|
+
export declare function derivedCases(entity: SchemaView, given?: Record<string, unknown>, options?: SampleOptions): readonly ValidationCase[];
|
|
12
6
|
//# sourceMappingURL=derive.d.ts.map
|
package/dist/derive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9D,sEAAsE;AACtE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,UAAU,EAClB,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,OAAO,GAAE,aAAkB,GAC1B,SAAS,cAAc,EAAE,CAE3B"}
|
package/dist/derive.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Cases } from '@fougere/schema';
|
|
2
2
|
import { sampleInput } from './sample.js';
|
|
3
|
-
/**
|
|
4
|
-
* The cases, with the valid body generated rather than handed in.
|
|
5
|
-
*
|
|
6
|
-
* `Cases` lives in `@fougere/schema` because deriving them reads the four axes and
|
|
7
|
-
* nothing else. This is the half that needs a generator, which is why it is here: a
|
|
8
|
-
* 426 KB faker has no business in the package a browser loads.
|
|
9
|
-
*/
|
|
3
|
+
/** The cases, with the valid body generated rather than handed in. */
|
|
10
4
|
export function derivedCases(entity, given = {}, options = {}) {
|
|
11
5
|
return Cases.of(entity, sampleInput(entity, given, options)).all;
|
|
12
6
|
}
|
package/dist/derive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.js","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"derive.js","sourceRoot":"","sources":["../src/derive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAE9D,sEAAsE;AACtE,MAAM,UAAU,YAAY,CAC1B,MAAkB,EAClB,KAAK,GAA4B,EAAE,EACnC,OAAO,GAAkB,EAAE;IAE3B,OAAO,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACnE,CAAC"}
|
package/dist/doors.d.ts
CHANGED
|
@@ -1,37 +1,19 @@
|
|
|
1
1
|
import { type App } from '@fougere/core';
|
|
2
2
|
import { type SchemaView, type ValidationError } from '@fougere/schema';
|
|
3
3
|
import { type SampleOptions } from './sample.js';
|
|
4
|
-
/** The one shape both the local
|
|
4
|
+
/** The one shape both the local validator and a door already speak. */
|
|
5
5
|
export interface Verdict {
|
|
6
6
|
success: boolean;
|
|
7
7
|
errors?: ValidationError[];
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* What a door answers, in the shape a verdict is compared in.
|
|
11
|
-
*
|
|
12
|
-
* A refusal reaches a caller as a thrown `FougereError` carrying `details`, not as a
|
|
13
|
-
* returned value — so the translation happens once, here, and every reader below compares
|
|
14
|
-
* the same thing.
|
|
15
|
-
*/
|
|
9
|
+
/** What a door answers, in the shape a verdict is compared in. */
|
|
16
10
|
export declare function verdictOf(call: () => Promise<unknown>): Promise<Verdict>;
|
|
17
11
|
export interface CheckOptions extends SampleOptions {
|
|
18
12
|
/** Values the generator cannot invent — the id of a row a `ref()` points at. */
|
|
19
13
|
given?: Record<string, unknown>;
|
|
20
14
|
}
|
|
21
|
-
/**
|
|
22
|
-
* The declared contract, posed to the façade that will receive it.
|
|
23
|
-
*
|
|
24
|
-
* Declares one `it` per case rather than looping inside a single one: a failure names the
|
|
25
|
-
* case, and a suite that lists what it checked is the point — the list comes from the
|
|
26
|
-
* entity, not from what the author remembered.
|
|
27
|
-
*/
|
|
15
|
+
/** The declared contract, posed to the façade that will receive it. */
|
|
28
16
|
export declare function checkContract(app: App, entity: SchemaView, options?: CheckOptions): void;
|
|
29
|
-
/**
|
|
30
|
-
* What may leave, checked against what the entity says may leave.
|
|
31
|
-
*
|
|
32
|
-
* Costs nothing to state: `Visibility.output` already answers it, and a field the boundary
|
|
33
|
-
* closes has no business in any response. A `password: text({ boundary: 'writeOnly' })`
|
|
34
|
-
* that reaches a caller is the one leak no reviewer catches by reading a handler.
|
|
35
|
-
*/
|
|
17
|
+
/** What may leave, checked against what the entity says may leave. */
|
|
36
18
|
export declare function checkOutput(app: App, entity: SchemaView, options?: CheckOptions): void;
|
|
37
19
|
//# sourceMappingURL=doors.d.ts.map
|
package/dist/doors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../src/doors.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGhG,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1E,
|
|
1
|
+
{"version":3,"file":"doors.d.ts","sourceRoot":"","sources":["../src/doors.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGhG,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1E,uEAAuE;AACvE,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,kEAAkE;AAClE,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAS9E;AAOD,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CAiB5F;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CA2B1F"}
|