@fuzdev/fuz_app 0.164.0 → 0.165.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/http/CLAUDE.md +2 -1
- package/dist/http/route_error_check.d.ts +21 -0
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +37 -1
- package/dist/http/schema_helpers.d.ts +15 -1
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +12 -3
- package/dist/testing/CLAUDE.md +75 -25
- package/dist/testing/admin_integration.js +1 -1
- package/dist/testing/adversarial_404.js +1 -1
- package/dist/testing/adversarial_input.js +2 -2
- package/dist/testing/assertions.d.ts +13 -3
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +21 -4
- package/dist/testing/attack_surface.d.ts +12 -0
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +8 -5
- package/dist/testing/cross_backend/in_process_setup.d.ts +7 -3
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +11 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -2
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +5 -2
- package/dist/testing/cross_backend/standard.d.ts +31 -0
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +9 -3
- package/dist/testing/data_exposure.d.ts +7 -0
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -3
- package/dist/testing/error_coverage.d.ts +35 -33
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +53 -43
- package/dist/testing/integration.d.ts +28 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +51 -18
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +4 -15
- package/dist/testing/middleware_gate_probes.d.ts +90 -0
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -0
- package/dist/testing/middleware_gate_probes.js +179 -0
- package/dist/testing/round_trip.d.ts +7 -0
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +3 -2
- package/dist/testing/schema_generators.d.ts +31 -9
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +53 -11
- package/dist/testing/transports/raw_http.d.ts +10 -2
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +10 -4
- package/package.json +1 -1
|
@@ -113,9 +113,11 @@ export const default_in_process_setup = (options) => async () => {
|
|
|
113
113
|
* Build the full in-process suite bundle in a single helper invocation.
|
|
114
114
|
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
115
115
|
* factory input the Tier 1 suites read at their top level
|
|
116
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`)
|
|
117
|
-
*
|
|
118
|
-
* (`
|
|
116
|
+
* (`session_options`, `create_route_specs`, `rpc_endpoints`), and the
|
|
117
|
+
* integration suite's `base_url` (`null`, no socket) and `max_body_bytes`
|
|
118
|
+
* (`app_options.max_body_size`) — so the call site spreads once and adds
|
|
119
|
+
* only suite-specific extras (`roles`, `skip_routes`, `input_overrides`,
|
|
120
|
+
* `db_factories`, ...).
|
|
119
121
|
*
|
|
120
122
|
* ```ts
|
|
121
123
|
* // Suite-extras-free call: helper output is the entire options bag.
|
|
@@ -162,11 +164,16 @@ export const default_in_process_suite_options = (options) => ({
|
|
|
162
164
|
// and live app stay in sync by construction.
|
|
163
165
|
bootstrap: options.bootstrap,
|
|
164
166
|
surface_route: options.app_options?.surface_route,
|
|
167
|
+
max_body_size: options.app_options?.max_body_size,
|
|
168
|
+
origin_carve_outs: options.app_options?.origin_carve_outs,
|
|
165
169
|
// `create_test_app` always passes a `daemon_token_state`
|
|
166
170
|
daemon_token: true
|
|
167
171
|
}),
|
|
168
172
|
capabilities: in_process_capabilities,
|
|
169
173
|
session_options: options.session_options,
|
|
170
174
|
create_route_specs: options.create_route_specs,
|
|
171
|
-
rpc_endpoints: options.rpc_endpoints
|
|
175
|
+
rpc_endpoints: options.rpc_endpoints,
|
|
176
|
+
// in-process: no socket, and the limit `create_app_server` mounts
|
|
177
|
+
base_url: null,
|
|
178
|
+
max_body_bytes: options.app_options?.max_body_size ?? undefined
|
|
172
179
|
});
|
|
@@ -227,8 +227,9 @@ export interface SpineCrossSuitesOptions {
|
|
|
227
227
|
/**
|
|
228
228
|
* The backend's request-body cap on `rpc_path`, in bytes, when it isn't the
|
|
229
229
|
* spine default (`SPINE_BODY_LIMIT_DEFAULT_BYTES`): the boundary
|
|
230
|
-
* `body_size`, `body_size_smuggling
|
|
231
|
-
* over-cap row probe
|
|
230
|
+
* `body_size`, `body_size_smuggling`, `transport_composition`'s RPC
|
|
231
|
+
* over-cap row and the standard bundle's body-limit probe of the RPC
|
|
232
|
+
* endpoint probe.
|
|
232
233
|
*/
|
|
233
234
|
readonly rpc_max_body_bytes?: number;
|
|
234
235
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine_suites.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/spine_suites.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAwF9B,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAmC,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAEN,KAAK,gCAAgC,EACrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEN,KAAK,2BAA2B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CAAC,EAAE,kBAAkB,CAAC;IACnD,6FAA6F;IAC7F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpE;AA2bD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAM,SAAS,KAAG,aAAa,CAAC,qBAAqB,CAC3D,CAAC;AAkLrC,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACrB;AAiCD;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACvC,eAAe,mBAAmB,EAClC,WAAW,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,KACpD,IAgBF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,8BAA8B,GAC1C,eAAe,mBAAmB,EAClC,QAAQ,aAAa,CAAC,cAAc,CAAC,KACnC,IAiCF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,sCAAsC,EAC9C,SAAS,uBAAuB,KAC9B,IAoCF,CAAC"}
|
|
@@ -485,7 +485,9 @@ const SUITE_ENTRIES = {
|
|
|
485
485
|
roles: c.options.roles,
|
|
486
486
|
rpc_success_fixtures: c.options.rpc_success_fixtures,
|
|
487
487
|
rpc_skip_methods: c.options.rpc_skip_methods,
|
|
488
|
-
rpc_input_overrides: c.options.rpc_input_overrides
|
|
488
|
+
rpc_input_overrides: c.options.rpc_input_overrides,
|
|
489
|
+
base_url: c.config.base_url,
|
|
490
|
+
rpc_max_body_bytes: c.options.rpc_max_body_bytes
|
|
489
491
|
}),
|
|
490
492
|
describe: describe_standard_cross_process_tests,
|
|
491
493
|
required: {
|
|
@@ -493,7 +495,8 @@ const SUITE_ENTRIES = {
|
|
|
493
495
|
surface_source: true,
|
|
494
496
|
session_options: true,
|
|
495
497
|
rpc_endpoints: true,
|
|
496
|
-
capabilities: true
|
|
498
|
+
capabilities: true,
|
|
499
|
+
base_url: true
|
|
497
500
|
}
|
|
498
501
|
},
|
|
499
502
|
testing_backdoor: {
|
|
@@ -39,7 +39,9 @@ import type { AppSurfaceSpec } from '../../http/surface.js';
|
|
|
39
39
|
import { type RpcSuccessFixtures } from '../rpc_round_trip.js';
|
|
40
40
|
import type { RpcEndpointsSuiteOption } from '../rpc_helpers.js';
|
|
41
41
|
import type { BackendCapabilities } from './capabilities.js';
|
|
42
|
+
import type { UncoveredEntry } from '../error_coverage.js';
|
|
42
43
|
import type { SetupTest, TestFixture } from './setup.js';
|
|
44
|
+
import type { RouteParamValues } from '../schema_generators.js';
|
|
43
45
|
/**
|
|
44
46
|
* Configuration for `describe_standard_cross_process_tests`.
|
|
45
47
|
*
|
|
@@ -85,6 +87,28 @@ export interface StandardCrossProcessTestOptions {
|
|
|
85
87
|
* `0` to skip the assertion entirely.
|
|
86
88
|
*/
|
|
87
89
|
error_coverage_min?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Base URL the spawned backend is reachable at. Forwarded to
|
|
92
|
+
* `describe_standard_integration_tests`, whose middleware-gate probes write
|
|
93
|
+
* their request heads to the socket.
|
|
94
|
+
*/
|
|
95
|
+
base_url: string;
|
|
96
|
+
/**
|
|
97
|
+
* Forwarded to `describe_standard_integration_tests` — the backend's
|
|
98
|
+
* request-body cap on every counted route but the RPC endpoint, when it
|
|
99
|
+
* isn't the spine default.
|
|
100
|
+
*/
|
|
101
|
+
max_body_bytes?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Forwarded to `describe_standard_integration_tests` — the backend's
|
|
104
|
+
* request-body cap on the RPC endpoint, when it isn't `max_body_bytes`.
|
|
105
|
+
*/
|
|
106
|
+
rpc_max_body_bytes?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Forwarded to `describe_standard_integration_tests` — called with the
|
|
109
|
+
* declared error paths of its counted routes it never observed.
|
|
110
|
+
*/
|
|
111
|
+
check_uncovered_errors?: (uncovered: Array<UncoveredEntry>) => void;
|
|
88
112
|
/**
|
|
89
113
|
* Forwarded to `describe_round_trip_validation` as `skip_routes`
|
|
90
114
|
* (`'METHOD /path'` keys). For consumer REST routes whose responses
|
|
@@ -100,6 +124,13 @@ export interface StandardCrossProcessTestOptions {
|
|
|
100
124
|
* over WS), as the in-process bundle's consumers pass it directly.
|
|
101
125
|
*/
|
|
102
126
|
data_exposure_skip_routes?: Array<string>;
|
|
127
|
+
/**
|
|
128
|
+
* Forwarded to `describe_round_trip_validation` and
|
|
129
|
+
* `describe_data_exposure_tests` as `param_values` (`'METHOD /path'` →
|
|
130
|
+
* param name → value), for a `{re}` param whose pattern refuses the
|
|
131
|
+
* generated value. See `RouteParamValues`.
|
|
132
|
+
*/
|
|
133
|
+
param_values?: RouteParamValues;
|
|
103
134
|
/**
|
|
104
135
|
* Forwarded to `describe_rpc_round_trip_tests` as `success_fixtures`
|
|
105
136
|
* (method name → async params factory). Drives a populated **success**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/standard.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,sBAA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C,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACpE;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,GAAG,CAC1B,MAAM,EACN,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CACnF,CAAC;CACF;AAED;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,+BAA+B,KACtC,IA6CF,CAAC"}
|
|
@@ -16,13 +16,18 @@ export const describe_standard_cross_process_tests = (options) => {
|
|
|
16
16
|
capabilities: options.capabilities,
|
|
17
17
|
session_options: options.session_options,
|
|
18
18
|
rpc_endpoints: options.rpc_endpoints,
|
|
19
|
-
error_coverage_min: options.error_coverage_min
|
|
19
|
+
error_coverage_min: options.error_coverage_min,
|
|
20
|
+
base_url: options.base_url,
|
|
21
|
+
max_body_bytes: options.max_body_bytes,
|
|
22
|
+
rpc_max_body_bytes: options.rpc_max_body_bytes,
|
|
23
|
+
check_uncovered_errors: options.check_uncovered_errors
|
|
20
24
|
});
|
|
21
25
|
describe_round_trip_validation({
|
|
22
26
|
setup_test: options.setup_test,
|
|
23
27
|
surface_source: options.surface_source,
|
|
24
28
|
skip_routes: options.round_trip_skip_routes,
|
|
25
|
-
success_fixtures: options.rest_success_fixtures
|
|
29
|
+
success_fixtures: options.rest_success_fixtures,
|
|
30
|
+
param_values: options.param_values
|
|
26
31
|
});
|
|
27
32
|
describe_rpc_round_trip_tests({
|
|
28
33
|
setup_test: options.setup_test,
|
|
@@ -36,7 +41,8 @@ export const describe_standard_cross_process_tests = (options) => {
|
|
|
36
41
|
describe_data_exposure_tests({
|
|
37
42
|
setup_test: options.setup_test,
|
|
38
43
|
surface_source: options.surface_source,
|
|
39
|
-
skip_routes: options.data_exposure_skip_routes
|
|
44
|
+
skip_routes: options.data_exposure_skip_routes,
|
|
45
|
+
param_values: options.param_values
|
|
40
46
|
});
|
|
41
47
|
if (options.roles) {
|
|
42
48
|
describe_standard_admin_integration_tests({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import type { AppSurfaceSpec } from '../http/surface.js';
|
|
3
|
+
import { type RouteParamValues } from './schema_generators.js';
|
|
3
4
|
import type { SetupTest } from './cross_backend/setup.js';
|
|
4
5
|
/**
|
|
5
6
|
* Recursively collect all property names from a JSON Schema.
|
|
@@ -63,6 +64,12 @@ export interface DataExposureTestOptions {
|
|
|
63
64
|
* (`'/path method_name params'` for params the server pushes over WebSocket).
|
|
64
65
|
*/
|
|
65
66
|
skip_routes?: Array<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Path param values for specific routes (`'METHOD /path'` → param name →
|
|
69
|
+
* value), used before the generated ones — needed for a `{re}` param whose
|
|
70
|
+
* pattern refuses the generated value. See `RouteParamValues`.
|
|
71
|
+
*/
|
|
72
|
+
param_values?: RouteParamValues;
|
|
66
73
|
}
|
|
67
74
|
/**
|
|
68
75
|
* Composable data exposure test suite.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAwB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAwB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKzD,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAchC,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAC;AAIvE;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,GAAI,QAAQ,OAAO,KAAG,GAAG,CAAC,MAAM,CAmC9E,CAAC;AA0HF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yCAAyC,GACrD,gBAAgB,cAAc,EAC9B,mBAAkB,aAAa,CAAC,MAAM,CAA6B,EACnE,cAAc,aAAa,CAAC,MAAM,CAAC,KACjC,IAOF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wCAAwC,GACpD,gBAAgB,cAAc,EAC9B,oBAAmB,aAAa,CAAC,MAAM,CAA8B,EACrE,cAAc,aAAa,CAAC,MAAM,CAAC,KACjC,IAYF,CAAC;AAIF,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACvC,kEAAkE;IAClE,UAAU,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IAiM/E,CAAC"}
|
|
@@ -257,7 +257,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
257
257
|
const route_key = format_route_key(spec);
|
|
258
258
|
if (skip_set.has(route_key))
|
|
259
259
|
continue;
|
|
260
|
-
const url = resolve_valid_path(spec.path, spec.params);
|
|
260
|
+
const url = resolve_valid_path(spec.path, spec.params, options.param_values?.[route_key]);
|
|
261
261
|
const res = await fixture.transport(url, {
|
|
262
262
|
method: spec.method,
|
|
263
263
|
headers: create_test_request_headers({
|
|
@@ -286,7 +286,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
286
286
|
const route_key = format_route_key(spec);
|
|
287
287
|
if (skip_set.has(route_key))
|
|
288
288
|
continue;
|
|
289
|
-
const url = resolve_valid_path(spec.path, spec.params);
|
|
289
|
+
const url = resolve_valid_path(spec.path, spec.params, options.param_values?.[route_key]);
|
|
290
290
|
const res = await fixture.transport(url, {
|
|
291
291
|
method: spec.method,
|
|
292
292
|
headers: {
|
|
@@ -324,7 +324,7 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
324
324
|
continue;
|
|
325
325
|
// keeper auth (daemon token) is strictly more privileged than admin
|
|
326
326
|
const is_elevated = is_elevated_auth(spec.auth);
|
|
327
|
-
const url = resolve_valid_path(spec.path, spec.params);
|
|
327
|
+
const url = resolve_valid_path(spec.path, spec.params, options.param_values?.[route_key]);
|
|
328
328
|
const body = generate_valid_body(spec.input);
|
|
329
329
|
const headers = pick_auth_headers(spec, fixture, authed_account, admin_account);
|
|
330
330
|
const request_init = {
|
|
@@ -20,17 +20,17 @@ export interface CoverageFilterOptions {
|
|
|
20
20
|
* Tracks which route × status (and route × status × code) combinations have
|
|
21
21
|
* been exercised in tests.
|
|
22
22
|
*
|
|
23
|
-
* Use `record()` to log an observed status
|
|
24
|
-
*
|
|
25
|
-
* (
|
|
23
|
+
* Use `record()` to log an observed status with the body's `error` code (`null`
|
|
24
|
+
* for none), or `assert_and_record()` to combine response validation with
|
|
25
|
+
* tracking (reads `body.error` from the response).
|
|
26
26
|
* After all tests, call `uncovered()` to find declared error paths never
|
|
27
27
|
* exercised.
|
|
28
28
|
*
|
|
29
|
-
* An observation
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* An observation with a code covers exactly that (route, status, code): a
|
|
30
|
+
* `forbidden_origin` 403 leaves a declared `credential_type_required` 403
|
|
31
|
+
* uncovered. An observation recorded with a `null` code — a response that
|
|
32
|
+
* carries none — satisfies the "any-code" rule for its status: every code
|
|
33
|
+
* declared there counts as covered.
|
|
34
34
|
*/
|
|
35
35
|
export declare class ErrorCoverageCollector {
|
|
36
36
|
/**
|
|
@@ -44,50 +44,51 @@ export declare class ErrorCoverageCollector {
|
|
|
44
44
|
*/
|
|
45
45
|
constructor(route_error_maps?: ReadonlyMap<string, RouteErrorMap> | null);
|
|
46
46
|
/**
|
|
47
|
-
* Observed keys: `"METHOD /spec-path:STATUS"`
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* code; a code-bearing key adds per-code precision.
|
|
47
|
+
* Observed keys: `"METHOD /spec-path:STATUS:CODE"` for an observation with a
|
|
48
|
+
* code, `"METHOD /spec-path:STATUS"` for one without, which covers every
|
|
49
|
+
* code declared at the status.
|
|
51
50
|
*/
|
|
52
51
|
readonly observed: Set<string>;
|
|
53
52
|
/**
|
|
54
|
-
* Record an observed error status
|
|
53
|
+
* Record an observed error status and its body's `error` code for a route.
|
|
55
54
|
*
|
|
56
55
|
* Resolves the concrete request path back to the spec template path
|
|
57
|
-
* (e.g., `/api/accounts/abc` → `/api/accounts/:id`).
|
|
58
|
-
*
|
|
56
|
+
* (e.g., `/api/accounts/abc` → `/api/accounts/:id`). A `code` covers that
|
|
57
|
+
* code alone; `null`, for a response that truly carries no code, covers
|
|
58
|
+
* every code declared at the status — so any-code coverage is asked for,
|
|
59
|
+
* never had by leaving the code out.
|
|
59
60
|
*
|
|
60
61
|
* @param path - request path (may be concrete)
|
|
61
|
-
* @param code -
|
|
62
|
-
* @mutates `this.observed` - adds
|
|
63
|
-
*
|
|
62
|
+
* @param code - the body's `error` code, or `null` when the response has none
|
|
63
|
+
* @mutates `this.observed` - adds `"METHOD /spec-path:STATUS:CODE"` for a
|
|
64
|
+
* code, `"METHOD /spec-path:STATUS"` for `null`.
|
|
64
65
|
*/
|
|
65
|
-
record(route_specs: Array<RouteSpec>, method: string, path: string, status: number, code
|
|
66
|
+
record(route_specs: Array<RouteSpec>, method: string, path: string, status: number, code: string | null): void;
|
|
66
67
|
/**
|
|
67
68
|
* Validate a response against its route spec and record the status.
|
|
68
69
|
*
|
|
69
|
-
* Wraps `assert_response_matches_spec` and records the status
|
|
70
|
-
* error
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* auto-extracted value or when the body was already consumed.
|
|
70
|
+
* Wraps `assert_response_matches_spec` and records the status with the
|
|
71
|
+
* body's `error` code, read from a clone so the original stream stays
|
|
72
|
+
* usable; a body with no string `error` records `null`. Pass `code` when
|
|
73
|
+
* the body was already consumed.
|
|
74
74
|
*
|
|
75
|
-
* @param code -
|
|
76
|
-
*
|
|
77
|
-
* is auto-extracted)
|
|
75
|
+
* @param code - the body's `error` code, or `null` when it has none; read
|
|
76
|
+
* from the body when omitted
|
|
78
77
|
* @mutates `this.observed` - via `record` after `assert_response_matches_spec`
|
|
79
78
|
* succeeds.
|
|
80
79
|
* @throws Error if the response body fails the route spec's declared
|
|
81
|
-
* schemas (propagated from `assert_response_matches_spec`)
|
|
80
|
+
* schemas (propagated from `assert_response_matches_spec`), or if the
|
|
81
|
+
* body was consumed and no `code` was given.
|
|
82
82
|
*/
|
|
83
|
-
assert_and_record(route_specs: Array<RouteSpec>, method: string, path: string, response: Response, code?: string): Promise<void>;
|
|
83
|
+
assert_and_record(route_specs: Array<RouteSpec>, method: string, path: string, response: Response, code?: string | null): Promise<void>;
|
|
84
84
|
/**
|
|
85
85
|
* Find declared error paths that were never observed.
|
|
86
86
|
*
|
|
87
87
|
* Computes the declared set from each route's error map
|
|
88
88
|
* (`resolve_route_error_map`, `this.route_error_maps`): one row per declared code
|
|
89
|
-
* at each status.
|
|
90
|
-
*
|
|
89
|
+
* at each status. An observation with a code covers that row alone; a
|
|
90
|
+
* status-only observation (a `null` code) covers every row at its status — the
|
|
91
|
+
* "any-code" rule.
|
|
91
92
|
*/
|
|
92
93
|
uncovered(route_specs: Array<RouteSpec>, options?: CoverageFilterOptions): Array<UncoveredEntry>;
|
|
93
94
|
}
|
|
@@ -107,8 +108,9 @@ export interface ErrorCoverageOptions extends CoverageFilterOptions {
|
|
|
107
108
|
*
|
|
108
109
|
* Computes the ratio of exercised error paths to total declared error paths,
|
|
109
110
|
* each declared code at each status of a route's error map
|
|
110
|
-
* (`collector.route_error_maps`) one path.
|
|
111
|
-
*
|
|
111
|
+
* (`collector.route_error_maps`) one path. An observation with a code covers
|
|
112
|
+
* that path alone; a status-only observation (a `null` code) covers every declared code at
|
|
113
|
+
* its status (the "any-code" rule).
|
|
112
114
|
*
|
|
113
115
|
* When `min_coverage` is 0 (default), logs coverage info without failing.
|
|
114
116
|
* When > 0, fails if coverage is below the threshold.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_coverage.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/error_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"error_coverage.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/error_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGlF,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;CACb;AAED,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACrC,kDAAkD;IAClD,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,iCAAiC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAgDD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,sBAAsB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;IAErE;;OAEG;gBACS,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI;IAIxE;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAE3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CACL,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,EAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,GACjB,IAAI;IASP;;;;;;;;;;;;;;;OAeG;IACG,iBAAiB,CACtB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,EAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAClB,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC;CAKhG;AAED;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD,2CAA2C;AAC3C,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IAClE,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAYD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GACjC,WAAW,sBAAsB,EACjC,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,UAAU,oBAAoB,KAC5B,IAsBF,CAAC"}
|
|
@@ -3,11 +3,13 @@ import './assert_dev_env.js';
|
|
|
3
3
|
* Error reachability coverage tracking.
|
|
4
4
|
*
|
|
5
5
|
* Tracks which declared error codes are actually exercised in tests.
|
|
6
|
-
* `ErrorCoverageCollector` records
|
|
7
|
-
* `error`
|
|
8
|
-
* compares against each route's error map
|
|
9
|
-
* uncovered error paths — one per declared
|
|
10
|
-
* the map's definitions.
|
|
6
|
+
* `ErrorCoverageCollector` records the error responses observed during test
|
|
7
|
+
* runs, each by its body's `error` code where it is known, then
|
|
8
|
+
* `assert_error_coverage` compares against each route's error map
|
|
9
|
+
* (`resolve_route_error_map`) to find uncovered error paths — one per declared
|
|
10
|
+
* code at each status, read from the map's definitions. An observation with a
|
|
11
|
+
* code covers that one path; one recorded with a `null` code covers every code
|
|
12
|
+
* declared at its status.
|
|
11
13
|
*
|
|
12
14
|
* @module
|
|
13
15
|
*/
|
|
@@ -21,8 +23,10 @@ import { find_route_spec, assert_response_matches_spec } from './integration_hel
|
|
|
21
23
|
* Single source of truth for the route → status → code traversal used by
|
|
22
24
|
* both `uncovered()` and `assert_error_coverage`. Yields one entry per
|
|
23
25
|
* declared (status, code) of each route's error map, read from its
|
|
24
|
-
* definitions, with a `covered` flag
|
|
25
|
-
*
|
|
26
|
+
* definitions, with a `covered` flag: covered when that code was observed
|
|
27
|
+
* at that status, or when the status was observed with a `null` code (the
|
|
28
|
+
* "any-code" rule, for a response that carries none). Every definition
|
|
29
|
+
* carries a code, so a declared status always has at least one.
|
|
26
30
|
*/
|
|
27
31
|
const walk_coverage = (collector, route_specs, options) => {
|
|
28
32
|
const ignore_routes = new Set(options?.ignore_routes);
|
|
@@ -52,17 +56,17 @@ const walk_coverage = (collector, route_specs, options) => {
|
|
|
52
56
|
* Tracks which route × status (and route × status × code) combinations have
|
|
53
57
|
* been exercised in tests.
|
|
54
58
|
*
|
|
55
|
-
* Use `record()` to log an observed status
|
|
56
|
-
*
|
|
57
|
-
* (
|
|
59
|
+
* Use `record()` to log an observed status with the body's `error` code (`null`
|
|
60
|
+
* for none), or `assert_and_record()` to combine response validation with
|
|
61
|
+
* tracking (reads `body.error` from the response).
|
|
58
62
|
* After all tests, call `uncovered()` to find declared error paths never
|
|
59
63
|
* exercised.
|
|
60
64
|
*
|
|
61
|
-
* An observation
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
65
|
+
* An observation with a code covers exactly that (route, status, code): a
|
|
66
|
+
* `forbidden_origin` 403 leaves a declared `credential_type_required` 403
|
|
67
|
+
* uncovered. An observation recorded with a `null` code — a response that
|
|
68
|
+
* carries none — satisfies the "any-code" rule for its status: every code
|
|
69
|
+
* declared there counts as covered.
|
|
66
70
|
*/
|
|
67
71
|
export class ErrorCoverageCollector {
|
|
68
72
|
/**
|
|
@@ -78,54 +82,58 @@ export class ErrorCoverageCollector {
|
|
|
78
82
|
this.route_error_maps = route_error_maps ?? null;
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
|
-
* Observed keys: `"METHOD /spec-path:STATUS"`
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* code; a code-bearing key adds per-code precision.
|
|
85
|
+
* Observed keys: `"METHOD /spec-path:STATUS:CODE"` for an observation with a
|
|
86
|
+
* code, `"METHOD /spec-path:STATUS"` for one without, which covers every
|
|
87
|
+
* code declared at the status.
|
|
85
88
|
*/
|
|
86
89
|
observed = new Set();
|
|
87
90
|
/**
|
|
88
|
-
* Record an observed error status
|
|
91
|
+
* Record an observed error status and its body's `error` code for a route.
|
|
89
92
|
*
|
|
90
93
|
* Resolves the concrete request path back to the spec template path
|
|
91
|
-
* (e.g., `/api/accounts/abc` → `/api/accounts/:id`).
|
|
92
|
-
*
|
|
94
|
+
* (e.g., `/api/accounts/abc` → `/api/accounts/:id`). A `code` covers that
|
|
95
|
+
* code alone; `null`, for a response that truly carries no code, covers
|
|
96
|
+
* every code declared at the status — so any-code coverage is asked for,
|
|
97
|
+
* never had by leaving the code out.
|
|
93
98
|
*
|
|
94
99
|
* @param path - request path (may be concrete)
|
|
95
|
-
* @param code -
|
|
96
|
-
* @mutates `this.observed` - adds
|
|
97
|
-
*
|
|
100
|
+
* @param code - the body's `error` code, or `null` when the response has none
|
|
101
|
+
* @mutates `this.observed` - adds `"METHOD /spec-path:STATUS:CODE"` for a
|
|
102
|
+
* code, `"METHOD /spec-path:STATUS"` for `null`.
|
|
98
103
|
*/
|
|
99
104
|
record(route_specs, method, path, status, code) {
|
|
100
105
|
const spec = find_route_spec(route_specs, method, path);
|
|
101
106
|
const spec_path = spec ? spec.path : path;
|
|
102
107
|
const base_key = `${method} ${spec_path}:${status}`;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
108
|
+
// a known code covers that code alone, so a refusal at a shared status
|
|
109
|
+
// is no evidence for the others there
|
|
110
|
+
this.observed.add(code === null ? base_key : `${base_key}:${code}`);
|
|
107
111
|
}
|
|
108
112
|
/**
|
|
109
113
|
* Validate a response against its route spec and record the status.
|
|
110
114
|
*
|
|
111
|
-
* Wraps `assert_response_matches_spec` and records the status
|
|
112
|
-
* error
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* auto-extracted value or when the body was already consumed.
|
|
115
|
+
* Wraps `assert_response_matches_spec` and records the status with the
|
|
116
|
+
* body's `error` code, read from a clone so the original stream stays
|
|
117
|
+
* usable; a body with no string `error` records `null`. Pass `code` when
|
|
118
|
+
* the body was already consumed.
|
|
116
119
|
*
|
|
117
|
-
* @param code -
|
|
118
|
-
*
|
|
119
|
-
* is auto-extracted)
|
|
120
|
+
* @param code - the body's `error` code, or `null` when it has none; read
|
|
121
|
+
* from the body when omitted
|
|
120
122
|
* @mutates `this.observed` - via `record` after `assert_response_matches_spec`
|
|
121
123
|
* succeeds.
|
|
122
124
|
* @throws Error if the response body fails the route spec's declared
|
|
123
|
-
* schemas (propagated from `assert_response_matches_spec`)
|
|
125
|
+
* schemas (propagated from `assert_response_matches_spec`), or if the
|
|
126
|
+
* body was consumed and no `code` was given.
|
|
124
127
|
*/
|
|
125
128
|
async assert_and_record(route_specs, method, path, response, code) {
|
|
129
|
+
if (code === undefined && response.bodyUsed) {
|
|
130
|
+
throw new Error(`assert_and_record: the body of ${method} ${path} was consumed; pass its code ` +
|
|
131
|
+
'(or `null` for none)');
|
|
132
|
+
}
|
|
126
133
|
await assert_response_matches_spec(route_specs, method, path, response, this.route_error_maps);
|
|
127
134
|
let resolved_code = code;
|
|
128
|
-
if (resolved_code === undefined
|
|
135
|
+
if (resolved_code === undefined) {
|
|
136
|
+
resolved_code = null;
|
|
129
137
|
try {
|
|
130
138
|
const body = await response.clone().json();
|
|
131
139
|
if (body && typeof body.error === 'string') {
|
|
@@ -143,8 +151,9 @@ export class ErrorCoverageCollector {
|
|
|
143
151
|
*
|
|
144
152
|
* Computes the declared set from each route's error map
|
|
145
153
|
* (`resolve_route_error_map`, `this.route_error_maps`): one row per declared code
|
|
146
|
-
* at each status.
|
|
147
|
-
*
|
|
154
|
+
* at each status. An observation with a code covers that row alone; a
|
|
155
|
+
* status-only observation (a `null` code) covers every row at its status — the
|
|
156
|
+
* "any-code" rule.
|
|
148
157
|
*/
|
|
149
158
|
uncovered(route_specs, options) {
|
|
150
159
|
return walk_coverage(this, route_specs, options)
|
|
@@ -170,8 +179,9 @@ const format_uncovered = (entry) => `${entry.method} ${entry.path} → ${entry.s
|
|
|
170
179
|
*
|
|
171
180
|
* Computes the ratio of exercised error paths to total declared error paths,
|
|
172
181
|
* each declared code at each status of a route's error map
|
|
173
|
-
* (`collector.route_error_maps`) one path.
|
|
174
|
-
*
|
|
182
|
+
* (`collector.route_error_maps`) one path. An observation with a code covers
|
|
183
|
+
* that path alone; a status-only observation (a `null` code) covers every declared code at
|
|
184
|
+
* its status (the "any-code" rule).
|
|
175
185
|
*
|
|
176
186
|
* When `min_coverage` is 0 (default), logs coverage info without failing.
|
|
177
187
|
* When > 0, fails if coverage is below the threshold.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
3
3
|
import { type RpcEndpointsSuiteOption } from './rpc_helpers.js';
|
|
4
|
+
import { type UncoveredEntry } from './error_coverage.js';
|
|
4
5
|
import type { AppSurfaceSpec } from '../http/surface.js';
|
|
5
6
|
import { type BackendCapabilities } from './cross_backend/capabilities.js';
|
|
6
7
|
import type { SetupTest } from './cross_backend/setup.js';
|
|
@@ -56,6 +57,31 @@ export interface StandardIntegrationTestOptions {
|
|
|
56
57
|
* denial-path drivers.
|
|
57
58
|
*/
|
|
58
59
|
error_coverage_min?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Base URL the backend is reachable at, or `null` in-process. The
|
|
62
|
+
* middleware-gate probes write their heads to the socket when there is one
|
|
63
|
+
* (`fetch` replaces a caller's `Host` and `Content-Length`), and go through
|
|
64
|
+
* the fixture's transport when there isn't.
|
|
65
|
+
*/
|
|
66
|
+
base_url: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The backend's request-body cap on every counted route but the RPC
|
|
69
|
+
* endpoint, in bytes — the body-limit probe declares one byte more.
|
|
70
|
+
* Default `SPINE_BODY_LIMIT_DEFAULT_BYTES`, the spines' default.
|
|
71
|
+
*/
|
|
72
|
+
max_body_bytes?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The backend's request-body cap on the RPC endpoint, in bytes, when it
|
|
75
|
+
* isn't `max_body_bytes`.
|
|
76
|
+
*/
|
|
77
|
+
rpc_max_body_bytes?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Called once the suite's tests have run, with the declared error paths of
|
|
80
|
+
* the counted routes it never observed, before the coverage floor is
|
|
81
|
+
* asserted — for a wiring that holds its coverage to an exact set, which
|
|
82
|
+
* catches one covered code swapped for another where a ratio can't.
|
|
83
|
+
*/
|
|
84
|
+
check_uncovered_errors?: (uncovered: Array<UncoveredEntry>) => void;
|
|
59
85
|
}
|
|
60
86
|
/**
|
|
61
87
|
* Standard integration test suite for fuz_app auth routes.
|
|
@@ -64,7 +90,8 @@ export interface StandardIntegrationTestOptions {
|
|
|
64
90
|
* revocation, password change (incl. API token revocation), origin
|
|
65
91
|
* verification, bearer auth (incl. browser context discard on mutations),
|
|
66
92
|
* token revocation, cross-account isolation, expired credential rejection,
|
|
67
|
-
* signup invite edge cases,
|
|
93
|
+
* signup invite edge cases, response body validation, and the middleware
|
|
94
|
+
* gates each counted route's error map declares (`middleware_gate_probes.ts`).
|
|
68
95
|
*
|
|
69
96
|
* Each test group asserts that required routes exist, failing with a descriptive
|
|
70
97
|
* message if the consumer's route specs are misconfigured.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAuB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA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